From 4b1cc17ed2332554d5c77fef77f3c8dd8ec46701 Mon Sep 17 00:00:00 2001 From: John Ryan Date: Tue, 1 Dec 2026 11:42:34 -0800 Subject: [PATCH 1/4] Run @TestOn('browser') tests on CI --- .github/workflows/build.yaml | 30 ++++++++++++++++++++++-------- tool/ci/bots.sh | 10 ++++++++-- tool/ci/package_tests.sh | 7 +------ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 717fb7f81de..9fded584433 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,6 +162,28 @@ jobs: PLATFORM: vm run: ./tool/ci/bots.sh + test-browser: + name: ${{ matrix.os }} test_browser + needs: flutter-prep + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + steps: + - name: git clone + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - name: Load Cached Flutter SDK + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + with: + path: | + ./tool/flutter-sdk + key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }} + - name: tool/ci/bots.sh + env: + BOT: test_browser + run: ./tool/ci/bots.sh + macos-test: needs: flutter-prep name: macos goldens ${{ matrix.bot }} @@ -395,11 +417,3 @@ jobs: # BOT: ${{ matrix.bot }} # run: ./tool/ci/bots.sh -# TODO(https://github.com/flutter/devtools/issues/2437): -# PLATFORM=chrome is going away. We need to move these tests to run with -# chromedriver. -# - BOT=test_ddc PLATFORM=chrome -# PLATFORM=chrome is going away. We need to move these tests to run with -# chromedriver. -# - BOT=test_dart2js PLATFORM=chrome - diff --git a/tool/ci/bots.sh b/tool/ci/bots.sh index 6f19b770e1f..c2e9ac5d94e 100755 --- a/tool/ci/bots.sh +++ b/tool/ci/bots.sh @@ -55,13 +55,19 @@ elif [[ "$BOT" == "test_ddc" || "$BOT" == "test_dart2js" ]]; then # used to do when integration tests were enabled). if [ "$PLATFORM" = "vm" ]; then WEBDEV_RELEASE=$USE_WEBDEV_RELEASE flutter test $FILES - elif [ "$PLATFORM" = "chrome" ]; then - WEBDEV_RELEASE=$USE_WEBDEV_RELEASE flutter test --platform chrome $FILES else echo "unknown test platform" exit 1 fi +elif [ "$BOT" = "test_browser" ]; then + FILES=$(grep -rlE "@TestOn\(['\"]browser['\"]\)" test | grep "_test.dart$" | tr '\n' ' ' || true) + if [ -z "$FILES" ]; then + echo "No @TestOn('browser') test files found in test/" + exit 1 + fi + flutter test --platform chrome $FILES + elif [ "$BOT" = "test_webdriver" ]; then flutter test webdriver_test diff --git a/tool/ci/package_tests.sh b/tool/ci/package_tests.sh index 6e086837e1c..47e3104b03d 100755 --- a/tool/ci/package_tests.sh +++ b/tool/ci/package_tests.sh @@ -33,12 +33,7 @@ elif [ "$PACKAGE" = "devtools_extensions" ]; then # Note that this will _not_ test any tests in nested directories, if we add # any. flutter test test/*_test.dart - # Skip this on Windows because `flutter test --platform chrome` - # appears to hang there. - # https://github.com/flutter/flutter/issues/162798 - if [[ $RUNNER_OS != "Windows" ]]; then - flutter test test/web --platform chrome - fi + flutter test test/web --platform chrome popd elif [ "$PACKAGE" = "devtools_shared" ]; then From 8c7e97e4bd805e8d89de87d5a6f17252a8113f59 Mon Sep 17 00:00:00 2001 From: John Ryan Date: Tue, 1 Dec 2026 14:30:10 -0800 Subject: [PATCH 2/4] Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- tool/ci/bots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/ci/bots.sh b/tool/ci/bots.sh index c2e9ac5d94e..0b34701c6d9 100755 --- a/tool/ci/bots.sh +++ b/tool/ci/bots.sh @@ -61,7 +61,7 @@ elif [[ "$BOT" == "test_ddc" || "$BOT" == "test_dart2js" ]]; then fi elif [ "$BOT" = "test_browser" ]; then - FILES=$(grep -rlE "@TestOn\(['\"]browser['\"]\)" test | grep "_test.dart$" | tr '\n' ' ' || true) + FILES=$(grep -rlE --include='*_test.dart' "@TestOn\\(['\"_test.dart..." test | tr '\n' ' ' || true) if [ -z "$FILES" ]; then echo "No @TestOn('browser') test files found in test/" exit 1 From 40280f18a44288bb08fbbbbc979158c7e54effac Mon Sep 17 00:00:00 2001 From: John Ryan Date: Wed, 2 Dec 2026 08:45:58 -0800 Subject: [PATCH 3/4] Fix regex --- tool/ci/bots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/ci/bots.sh b/tool/ci/bots.sh index 0b34701c6d9..14df1485f63 100755 --- a/tool/ci/bots.sh +++ b/tool/ci/bots.sh @@ -61,7 +61,7 @@ elif [[ "$BOT" == "test_ddc" || "$BOT" == "test_dart2js" ]]; then fi elif [ "$BOT" = "test_browser" ]; then - FILES=$(grep -rlE --include='*_test.dart' "@TestOn\\(['\"_test.dart..." test | tr '\n' ' ' || true) + FILES=$(grep -rlE --include='*_test.dart' "@TestOn\(['\"]browser['\"]\)" test | tr '\n' ' ' || true) if [ -z "$FILES" ]; then echo "No @TestOn('browser') test files found in test/" exit 1 From dcc50efaa873e13201807b41be2e31b4729a5907 Mon Sep 17 00:00:00 2001 From: John Ryan Date: Wed, 2 Dec 2026 11:07:12 -0800 Subject: [PATCH 4/4] Skip Chrome tests on windows-latest --- .github/workflows/build.yaml | 10 ++++------ tool/ci/package_tests.sh | 7 ++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9fded584433..b76d69c91f9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,14 +162,12 @@ jobs: PLATFORM: vm run: ./tool/ci/bots.sh + # Only run on ubuntu-latest because `flutter test --platform chrome` hangs on + # windows-latest (see https://github.com/flutter/flutter/issues/162798). test-browser: - name: ${{ matrix.os }} test_browser + name: ubuntu-latest test_browser needs: flutter-prep - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] + runs-on: ubuntu-latest steps: - name: git clone uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 diff --git a/tool/ci/package_tests.sh b/tool/ci/package_tests.sh index 47e3104b03d..6e086837e1c 100755 --- a/tool/ci/package_tests.sh +++ b/tool/ci/package_tests.sh @@ -33,7 +33,12 @@ elif [ "$PACKAGE" = "devtools_extensions" ]; then # Note that this will _not_ test any tests in nested directories, if we add # any. flutter test test/*_test.dart - flutter test test/web --platform chrome + # Skip this on Windows because `flutter test --platform chrome` + # appears to hang there. + # https://github.com/flutter/flutter/issues/162798 + if [[ $RUNNER_OS != "Windows" ]]; then + flutter test test/web --platform chrome + fi popd elif [ "$PACKAGE" = "devtools_shared" ]; then