Skip to content

Run some extra bots on GH using Antigravity#5924

Merged
DanTup merged 1 commit intomasterfrom
test-with-antigravity
Feb 25, 2026
Merged

Run some extra bots on GH using Antigravity#5924
DanTup merged 1 commit intomasterfrom
test-with-antigravity

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Feb 24, 2026

No description provided.

@DanTup DanTup added this to the v3.130.0 milestone Feb 24, 2026
@DanTup DanTup added the is testing Relates to the testing (either manual or automated) of Dart Code label Feb 24, 2026
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.62%. Comparing base (70241b9) to head (f6b1289).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5924      +/-   ##
==========================================
+ Coverage   67.60%   67.62%   +0.02%     
==========================================
  Files         169      169              
  Lines       12980    12980              
  Branches     2567     2567              
==========================================
+ Hits         8775     8778       +3     
+ Misses       3750     3745       -5     
- Partials      455      457       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DanTup DanTup force-pushed the test-with-antigravity branch from 2de85f5 to 6ed6082 Compare February 24, 2026 17:48
@DanTup DanTup requested a review from Copilot February 24, 2026 17:48
@DanTup
Copy link
Member Author

DanTup commented Feb 24, 2026

@codex review

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the ability to run tests against a pre-installed IDE by specifying it in the BOT environment variable. This is achieved by adding the which package to find the IDE executable and modifying the test runner script. The logic for selecting which test bots to run has also been refactored into a helper function for improved readability and to support the new environment variable format. My feedback includes a minor suggestion to improve code clarity.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull 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 which package dependency to locate IDE executables in PATH
  • Added new bot configurations for dart-antigravity and dart_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 [email protected], @types/[email protected], and [email protected] 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.
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Using PowerShell to query the actual installation path from the registry or Chocolatey
  2. Using Get-Command or similar to locate the executable
  3. 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

Copilot uses AI. Check for mistakes.

try {
const res = await vstest.runTests({
vscodeExecutablePath: ideOverride,
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When ideOverride is undefined (i.e., when not using an IDE override), the code passes vscodeExecutablePath: undefined to vstest.runTests(). While this may be intentional and likely works correctly, it would be more explicit and maintainable to only include the vscodeExecutablePath property when it has a defined value. Consider using a conditional property assignment or object spread to only include this property when ideOverride is not undefined.

Copilot uses AI. Check for mistakes.
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'
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition !startsWith(matrix.bot, 'dart') on line 112 will exclude dart-antigravity and dart_debug-antigravity from Flutter setup, which appears to be correct since these are Dart-only bots. However, the condition on line 118 startsWith(matrix.bot, 'dart') will include these bots for Dart setup, which is also correct. While the logic appears to work correctly, it would be clearer to document this behavior or add a comment explaining that bots starting with 'dart' (including 'dart-antigravity' and 'dart_debug-antigravity') should only use Dart, not Flutter. This is particularly important because the bot naming convention has changed to include hyphens, which might be confusing.

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +130
function shouldRunBot(name: string) {
return !process.env.BOT || process.env.BOT === name || process.env.BOT.startsWith(`${name}-`);
}
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shouldRunBot function on line 128-130 is defined inside runAllTests(). Since this function is only used within runAllTests(), this is acceptable. However, for better testability and reusability, consider extracting this function to the module level. This would make it easier to test the bot filtering logic independently and potentially reuse it in other contexts.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
run: |
brew install --cask antigravity
echo "$(dirname "$(command -v agy)")" >> "$GITHUB_PATH"
echo "ANTIGRAVITY_EXE=agy" >> "$GITHUB_ENV"
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 94, the script adds the directory containing agy to the PATH, but on line 95 it sets ANTIGRAVITY_EXE=agy. This appears inconsistent with the logic in test_all.ts line 68, which expects ANTIGRAVITY_EXE to be either a full path or executable name. If agy is added to PATH on line 94, then the ANTIGRAVITY_EXE environment variable should be set to the full path to the executable (similar to Windows), or the executable name should match what's expected by the test code. The current implementation may work but creates an inconsistency between platforms where Windows uses a full path and macOS uses just the command name.

Suggested change
echo "ANTIGRAVITY_EXE=agy" >> "$GITHUB_ENV"
echo "ANTIGRAVITY_EXE=$(command -v agy)" >> "$GITHUB_ENV"

Copilot uses AI. Check for mistakes.
@DanTup DanTup force-pushed the test-with-antigravity branch from 6ed6082 to f6b1289 Compare February 24, 2026 17:57
@DanTup DanTup force-pushed the test-with-antigravity branch from f6b1289 to b1b7dfb Compare February 25, 2026 10:30
@DanTup DanTup merged commit 503f29f into master Feb 25, 2026
22 checks passed
@DanTup DanTup deleted the test-with-antigravity branch February 25, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is testing Relates to the testing (either manual or automated) of Dart Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants