Skip to content

test(vmaas): run the Agent Engine environment tests with GNU coreutils off Linux - #7790

Closed
iamthehimansh wants to merge 1 commit into
google:mainfrom
iamthehimansh:fix/vmaas-tests-macos
Closed

iamthehimansh wants to merge 1 commit into
google:mainfrom
iamthehimansh:fix/vmaas-tests-macos

Conversation

@iamthehimansh

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

Problem:
test_agent_engine_environment.py runs the sandbox's commands in a local bash (_FakeSandboxes.execute_bash). Those commands use GNU coreutils options: stat -c, base64 -d FILE, dd iflag=fullblock, mv -T and chmod --reference. The BSD tools on macOS reject them, so 13 tests fail on a Mac (e.g. stat: illegal option -- c). The production sandbox is Linux and CI runs on ubuntu-latest, so only local development is affected.

Solution:
This is a test-only change. Production code and Linux CI behave exactly as before.

  • On non-Linux hosts where the GNU tools are installed with a g prefix (Homebrew coreutils: gstat, gbase64, gdd, gmv, gchmod), the fake shell runs with a temporary directory of links named stat, base64, dd, mv and chmod first on PATH. The directory is created once per test session and removed at exit.
  • Where they aren't installed, only the 13 tests that need them are skipped, with the reason needs GNU coreutils ... brew install coreutils. That's 10 test functions, plus 3 of the 4 test_write_is_split_at_chunk_boundaries cases; exactly_one_chunk doesn't need them and still runs.
  • On Linux nothing changes: no PATH change and no skips.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

All runs on macOS 26.6.2 (arm64), Python 3.13.15, pip install -e '.[test]':

pytest tests/unittests/integrations/vmaas/test_agent_engine_environment.py Result
main (571670d), GNU coreutils installed 13 failed, 33 passed
this PR, GNU coreutils installed 46 passed
this PR, GNU coreutils not on PATH 33 passed, 13 skipped
  • No leftover adk-gnu-coreutils-* temp directory after the runs.
  • Full pytest tests/unittests with this PR: 21,626 passed, 99 skipped, 1 failed. The one failure is test_remote_a2a_agent.py::...::test_ensure_resolved_uses_custom_factory, which is unrelated: it comes from a2a-sdk 1.3.0 and is fixed separately in fix(a2a): stamp A2A-Version on the rebound client with a2a-sdk 1.3 #7777. On main the same run had 14 failures (these 13 plus that one).
  • pyink --check and isort --check-only (repo config) pass.

Manual End-to-End (E2E) Tests:

N/A, test infrastructure only.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

This implements option 2 from #7778, the approach also suggested there by @Samecho.

AI use: this PR was prepared with an AI assistant. It found the failures by running the unit suite on macOS, wrote the change, and ran every command shown above on my machine. The output above is from those runs.

AI-assisted: yes (Cana)

…s off Linux

The fake sandbox runs the environment's commands in a local bash, and those
commands use GNU-only options (stat -c, base64 -d FILE, dd iflag=fullblock,
mv -T, chmod --reference), so 13 tests failed on macOS. Put links to the
g-prefixed GNU tools (Homebrew coreutils) first on PATH when they are
installed, and skip only the tests that need them when they are not.

Closes google#7778
@adk-bot

adk-bot commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Thank you @iamthehimansh for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 051c62d.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Nov 3, 2026
@adk-bot adk-bot closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged [Status] This PR is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_agent_engine_environment.py: 13 tests fail on macOS (GNU-only stat -c / base64 -d <file> in the local bash)

3 participants