Conversation
DanTup
added
the
is testing
label
Feb 24, 2026Pull request overview
This pull request adds support for running tests with alternative IDEs (specifically "Antigravity") on GitHub Actions. The implementation allows specifying a bot name with a suffix (e.g., "dart-antigravity") to run tests against a different IDE instead of the default VS Code.
Changes:
- Added logic to parse IDE override from bot names with hyphen suffixes
- Added
whichpackage dependency to locate IDE executables in PATH - Added new bot configurations for
dart-antigravityanddart_debug-antigravity - Added GitHub Actions workflow steps to install Antigravity on Linux, macOS, and Windows
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| src/test/test_all.ts | Added IDE override logic to parse bot names, resolve executable paths using which, and pass custom IDE executables to test runner; refactored bot filtering into shouldRunBot helper function |
| package.json | Added which@^6.0.1 and @types/which@^3.0.4 as dev dependencies |
| package-lock.json | Updated lock file with which@6.0.1, @types/which@3.0.4, and isexe@4.0.0 dependencies |
| .github/workflows/build-and-test.yml | Added dart-antigravity and dart_debug-antigravity to bot matrix; added platform-specific Antigravity installation steps; updated step names from "Setup" to "Set up" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines +100 to +104
| # HACK: We can use: | ||
| # Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | ||
| # refreshenv | ||
| # To update PATH, but it goes to the `bin` folder and we want the .exe, so we just | ||
| # hard-code it for now. |
The comment on line 100-104 mentions using Import-Module and refreshenv as a potential alternative, but notes it goes to the bin folder and "we want the .exe". However, this comment is somewhat unclear - it doesn't explain why going to the bin folder is a problem, or why the hardcoded path is preferred. Consider clarifying this comment to explain that refreshenv updates PATH to include the bin directory, but the actual executable is in a different location (the hardcoded path), which is why the hardcoded approach is necessary.
Suggested change
| # HACK: We can use: | |
| # Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
| # refreshenv | |
| # To update PATH, but it goes to the `bin` folder and we want the .exe, so we just | |
| # hard-code it for now. | |
| # HACK: We could instead do: | |
| # Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
| # refreshenv | |
| # which refreshes PATH so that the Chocolatey "bin" directory (with shims) is used. | |
| # However, here we need a stable, direct path to the actual Antigravity .exe for | |
| # ANTIGRAVITY_EXE, which is installed under Programs on the GitHub runner. For that | |
| # reason we hard-code the full .exe path instead of relying on the bin shim. |
Comment on lines +100 to +107
| # HACK: We can use: | ||
| # Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | ||
| # refreshenv | ||
| # To update PATH, but it goes to the `bin` folder and we want the .exe, so we just | ||
| # hard-code it for now. | ||
| run: | | ||
| choco install antigravity --yes | ||
| "ANTIGRAVITY_EXE=C:\Users\runneradmin\AppData\Local\Programs\Antigravity\Antigravity.exe" >> $env:GITHUB_ENV |
The hardcoded path C:\Users\runneradmin\AppData\Local\Programs\Antigravity\Antigravity.exe assumes a specific installation location that may not be stable across different Chocolatey versions or Antigravity package updates. If the installation path changes, the tests will fail. Consider using a more robust approach such as:
- Using PowerShell to query the actual installation path from the registry or Chocolatey
- Using
Get-Commandor similar to locate the executable - At minimum, add a validation step to verify the file exists before setting the environment variable
Suggested change
| # HACK: We can use: | |
| # Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
| # refreshenv | |
| # To update PATH, but it goes to the `bin` folder and we want the .exe, so we just | |
| # hard-code it for now. | |
| run: | | |
| choco install antigravity --yes | |
| "ANTIGRAVITY_EXE=C:\Users\runneradmin\AppData\Local\Programs\Antigravity\Antigravity.exe" >> $env:GITHUB_ENV | |
| # Install Antigravity and locate the actual executable path dynamically. | |
| run: | | |
| choco install antigravity --yes | |
| # Try to locate the Antigravity executable using PATH. | |
| $agyPath = Get-Command -Name Antigravity -CommandType Application -ErrorAction SilentlyContinue | | |
| Select-Object -First 1 -ExpandProperty Source | |
| # Fallback to the previous default path if Get-Command did not find anything. | |
| if (-not $agyPath) { | |
| $defaultPath = 'C:\Users\runneradmin\AppData\Local\Programs\Antigravity\Antigravity.exe' | |
| if (Test-Path $defaultPath) { | |
| $agyPath = $defaultPath | |
| } else { | |
| Write-Error "Could not locate Antigravity executable. Checked PATH and default location '$defaultPath'." | |
| exit 1 | |
| } | |
| } | |
| "ANTIGRAVITY_EXE=$agyPath" >> $env:GITHUB_ENV |
|
|
||
| try { | ||
| const res = await vstest.runTests({ | ||
| vscodeExecutablePath: ideOverride, |
Comment on lines 112 to 118
| if: matrix.bot != 'flutter_snap' && !startsWith(matrix.bot, 'dart') | ||
| uses: DanTup/gh-actions/setup-flutter@ca35b836161b1f7f8659345bad839ede5f4e3b94 | ||
| with: | ||
| channel: ${{ matrix.build-version }} | ||
|
|
||
| - name: Setup Dart ${{ matrix.build-version }} | ||
| - name: Set up Dart ${{ matrix.build-version }} | ||
| if: startsWith(matrix.bot, 'dart') || matrix.bot == 'misc' |
Comment on lines +128 to +130
Comment on lines +83 to +87
| run: | | ||
| sudo mkdir -p /etc/apt/keyrings | ||
| curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg | ||
| echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev antigravity-debian main" | sudo tee /etc/apt/sources.list.d/antigravity.list | ||
| sudo apt-get update && sudo apt-get install antigravity -y |
The Linux installation step uses us-central1-apt.pkg.dev without any error handling or verification. If the package repository is unavailable or if the antigravity package doesn't exist in the repository, the installation will fail. Consider adding verification steps after installation to ensure the package was installed successfully and that the antigravity executable is available in the PATH.
Suggested change
| run: | | |
| sudo mkdir -p /etc/apt/keyrings | |
| curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg | |
| echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev antigravity-debian main" | sudo tee /etc/apt/sources.list.d/antigravity.list | |
| sudo apt-get update && sudo apt-get install antigravity -y | |
| run: | | |
| set -euo pipefail | |
| sudo mkdir -p /etc/apt/keyrings | |
| curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg | |
| echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev antigravity-debian main" | sudo tee /etc/apt/sources.list.d/antigravity.list | |
| sudo apt-get update && sudo apt-get install antigravity -y | |
| if ! dpkg -s antigravity >/dev/null 2>&1; then | |
| echo "Error: 'antigravity' package does not appear to be installed after apt-get install." >&2 | |
| exit 1 | |
| fi | |
| if ! command -v agy >/dev/null 2>&1; then | |
| echo "Error: Antigravity executable 'agy' is not available on PATH after installation." >&2 | |
| exit 1 | |
| fi |
| run: | | ||
| brew install --cask antigravity | ||
| echo "$(dirname "$(command -v agy)")" >> "$GITHUB_PATH" | ||
| echo "ANTIGRAVITY_EXE=agy" >> "$GITHUB_ENV" |