From 810fb7835da9ac89924393170cc6e1a77ec0c9ac Mon Sep 17 00:00:00 2001 From: David Morgan Date: Mon, 15 Sep 2025 11:02:13 +0200 Subject: [PATCH] Improve slow integration tests. --- .github/workflows/dart.yml | 416 ++++++---------- build_daemon/CHANGELOG.md | 1 + build_daemon/lib/client.dart | 25 +- build_runner/dart_test.yaml | 8 +- build_runner/mono_pkg.yaml | 18 +- .../test/commands/daemon/daemon_test.dart | 463 ------------------ .../serve/serve_integration_test.dart | 4 - .../test/common/build_runner_tester.dart | 11 +- build_runner/test/common/common.dart | 2 - build_runner/test/common/descriptors.dart | 74 --- build_runner/test/common/matchers.dart | 2 - build_runner/test/common/package_graphs.dart | 1 - build_runner/test/common/sdk.dart | 57 --- .../build_command_build_filter_test.dart | 2 +- .../build_command_config_validation_test.dart | 2 +- .../build_command_define_test.dart | 2 +- .../build_command_errors_test.dart | 2 +- .../build_command_find_assets_test.dart | 2 +- .../build_command_invalidation_test.dart | 2 +- ...ild_command_output_only_required_test.dart | 2 +- .../build_command_output_test.dart | 2 +- .../integration_tests/clean_command_test.dart | 2 +- .../daemon_command_test.dart | 212 ++++++++ .../integration_tests/run_command_test.dart | 2 +- ...erve_command_serve_only_required_test.dart | 2 +- .../integration_tests/serve_command_test.dart | 2 +- .../integration_tests/test_command_test.dart | 2 +- .../watch_command_invalidation_test.dart | 2 +- tool/ci.sh | 48 +- 29 files changed, 446 insertions(+), 924 deletions(-) delete mode 100644 build_runner/test/commands/daemon/daemon_test.dart delete mode 100644 build_runner/test/common/descriptors.dart delete mode 100644 build_runner/test/common/sdk.dart create mode 100644 build_runner/test/integration_tests/daemon_command_test.dart diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 16e273a39d..5d07073e87 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -353,7 +353,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -387,7 +387,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_config;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_config;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_config os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -421,7 +421,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_daemon;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_daemon;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_daemon os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -455,7 +455,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_test;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_test;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_test os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -489,7 +489,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_web_compilers;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_web_compilers;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_web_compilers os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -523,7 +523,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:scratch_space;commands:test_03" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:scratch_space;commands:test_3" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:scratch_space os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -557,7 +557,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_modules;commands:test_04" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_modules;commands:test_4" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_modules os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -591,7 +591,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_06" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_6" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -618,14 +618,14 @@ jobs: - job_002 - job_003 job_014: - name: "unit_test; linux; PKG: build_runner; `dart test -t integration --test-randomize-ordering-seed=random`" + name: "unit_test; linux; PKG: build_runner; `dart test -t integration1 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_07" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_7" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -643,8 +643,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: "build_runner; dart test -t integration --test-randomize-ordering-seed=random" - run: "dart test -t integration --test-randomize-ordering-seed=random" + - name: "build_runner; dart test -t integration1 --test-randomize-ordering-seed=random" + run: "dart test -t integration1 --test-randomize-ordering-seed=random" if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: @@ -652,14 +652,14 @@ jobs: - job_002 - job_003 job_015: - name: "unit_test; linux; PKG: build_runner; `dart test -x integration -x slow --test-randomize-ordering-seed=random`" + name: "unit_test; linux; PKG: build_runner; `dart test -t integration2 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_05" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_8" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -677,8 +677,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: "build_runner; dart test -x integration -x slow --test-randomize-ordering-seed=random" - run: "dart test -x integration -x slow --test-randomize-ordering-seed=random" + - name: "build_runner; dart test -t integration2 --test-randomize-ordering-seed=random" + run: "dart test -t integration2 --test-randomize-ordering-seed=random" if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: @@ -686,57 +686,19 @@ jobs: - job_002 - job_003 job_016: - name: "unit_test; windows; PKG: _test; `dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: _test_pub_upgrade - name: _test; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: _test - - name: "_test; dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random" - run: "dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random" - if: "always() && steps._test_pub_upgrade.conclusion == 'success'" - working-directory: _test - needs: - - job_001 - - job_002 - - job_003 - job_017: - name: "unit_test; windows; PKG: build_daemon; `dart test --test-randomize-ordering-seed=random`" - runs-on: windows-latest + name: "unit_test; linux; PKG: build_runner; `dart test -t integration3 --test-randomize-ordering-seed=random`" + runs-on: ubuntu-latest steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + - name: Cache Pub hosted dependencies + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: build_daemon_pub_upgrade - name: build_daemon; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: build_daemon - - name: "build_daemon; dart test --test-randomize-ordering-seed=random" - run: "dart test --test-randomize-ordering-seed=random" - if: "always() && steps.build_daemon_pub_upgrade.conclusion == 'success'" - working-directory: build_daemon - needs: - - job_001 - - job_002 - - job_003 - job_018: - name: "unit_test; windows; PKG: build_runner; `dart test -t integration --test-randomize-ordering-seed=random`" - runs-on: windows-latest - steps: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_9" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: @@ -749,23 +711,23 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: "build_runner; dart test -t integration --test-randomize-ordering-seed=random" - run: "dart test -t integration --test-randomize-ordering-seed=random" + - name: "build_runner; dart test -t integration3 --test-randomize-ordering-seed=random" + run: "dart test -t integration3 --test-randomize-ordering-seed=random" if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: - job_001 - job_002 - job_003 - job_019: - name: "leak_check; linux; PKG: build_runner; `../tool/leak_check.sh`" + job_017: + name: "unit_test; linux; PKG: build_runner; `dart test -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:command_2" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_5" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -783,43 +745,18 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: build_runner; ../tool/leak_check.sh - run: ../tool/leak_check.sh + - name: "build_runner; dart test -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random" + run: "dart test -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random" if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: - job_001 - job_002 - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - - job_009 - - job_010 - - job_011 - - job_012 - - job_013 - - job_014 - - job_015 - - job_016 - - job_017 - - job_018 - job_020: - name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random`" - runs-on: ubuntu-latest + job_018: + name: "unit_test; windows; PKG: _test; `dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random`" + runs-on: windows-latest steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_00" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: @@ -832,44 +769,18 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: _test - - name: "_test; dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random" - run: "dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random" + - name: "_test; dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random" + run: "dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random" if: "always() && steps._test_pub_upgrade.conclusion == 'success'" working-directory: _test needs: - job_001 - job_002 - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - - job_009 - - job_010 - - job_011 - - job_012 - - job_013 - - job_014 - - job_015 - - job_016 - - job_017 - - job_018 - - job_019 - job_021: - name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random`" - runs-on: ubuntu-latest + job_019: + name: "unit_test; windows; PKG: build_daemon; `dart test --test-randomize-ordering-seed=random`" + runs-on: windows-latest steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_01" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: @@ -877,49 +788,23 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: _test_pub_upgrade - name: _test; dart pub upgrade + - id: build_daemon_pub_upgrade + name: build_daemon; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: _test - - name: "_test; dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random" - run: "dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random" - if: "always() && steps._test_pub_upgrade.conclusion == 'success'" - working-directory: _test + working-directory: build_daemon + - name: "build_daemon; dart test --test-randomize-ordering-seed=random" + run: "dart test --test-randomize-ordering-seed=random" + if: "always() && steps.build_daemon_pub_upgrade.conclusion == 'success'" + working-directory: build_daemon needs: - job_001 - job_002 - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - - job_009 - - job_010 - - job_011 - - job_012 - - job_013 - - job_014 - - job_015 - - job_016 - - job_017 - - job_018 - - job_019 - job_022: - name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random`" - runs-on: ubuntu-latest + job_020: + name: "unit_test; windows; PKG: build_runner; `dart test -t integration1 --test-randomize-ordering-seed=random`" + runs-on: windows-latest steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_02" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: @@ -927,49 +812,47 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: _test_pub_upgrade - name: _test; dart pub upgrade + - id: build_runner_pub_upgrade + name: build_runner; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: _test - - name: "_test; dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random" - run: "dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random" - if: "always() && steps._test_pub_upgrade.conclusion == 'success'" - working-directory: _test + working-directory: build_runner + - name: "build_runner; dart test -t integration1 --test-randomize-ordering-seed=random" + run: "dart test -t integration1 --test-randomize-ordering-seed=random" + if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" + working-directory: build_runner needs: - job_001 - job_002 - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - - job_009 - - job_010 - - job_011 - - job_012 - - job_013 - - job_014 - - job_015 - - job_016 - - job_017 - - job_018 - - job_019 - job_023: - name: "e2e_test; linux; PKG: build_runner; `dart test -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1`" - runs-on: ubuntu-latest + job_021: + name: "unit_test; windows; PKG: build_runner; `dart test -t integration2 --test-randomize-ordering-seed=random`" + runs-on: windows-latest steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 + - name: Setup Dart SDK + uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_08" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - id: build_runner_pub_upgrade + name: build_runner; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: build_runner + - name: "build_runner; dart test -t integration2 --test-randomize-ordering-seed=random" + run: "dart test -t integration2 --test-randomize-ordering-seed=random" + if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" + working-directory: build_runner + needs: + - job_001 + - job_002 + - job_003 + job_022: + name: "unit_test; windows; PKG: build_runner; `dart test -t integration3 --test-randomize-ordering-seed=random`" + runs-on: windows-latest + steps: - name: Setup Dart SDK uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: @@ -982,39 +865,23 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: "build_runner; dart test -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1" - run: "dart test -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1" + - name: "build_runner; dart test -t integration3 --test-randomize-ordering-seed=random" + run: "dart test -t integration3 --test-randomize-ordering-seed=random" if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: - job_001 - job_002 - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - - job_009 - - job_010 - - job_011 - - job_012 - - job_013 - - job_014 - - job_015 - - job_016 - - job_017 - - job_018 - - job_019 - job_024: - name: "e2e_test; linux; PKG: build_runner; `dart test -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1`" + job_023: + name: "leak_check; linux; PKG: build_runner; `../tool/leak_check.sh`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_09" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:command_2" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner os:ubuntu-latest;pub-cache-hosted;sdk:dev @@ -1032,8 +899,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: build_runner - - name: "build_runner; dart test -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1" - run: "dart test -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1" + - name: build_runner; ../tool/leak_check.sh + run: ../tool/leak_check.sh if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" working-directory: build_runner needs: @@ -1056,17 +923,20 @@ jobs: - job_017 - job_018 - job_019 - job_025: - name: "e2e_test; linux; PKG: build_runner; `dart test -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1`" + - job_020 + - job_021 + - job_022 + job_024: + name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_10" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_0" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test os:ubuntu-latest;pub-cache-hosted;sdk:dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -1077,15 +947,15 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: build_runner_pub_upgrade - name: build_runner; dart pub upgrade + - id: _test_pub_upgrade + name: _test; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: build_runner - - name: "build_runner; dart test -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1" - run: "dart test -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1" - if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" - working-directory: build_runner + working-directory: _test + - name: "_test; dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random" + run: "dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random" + if: "always() && steps._test_pub_upgrade.conclusion == 'success'" + working-directory: _test needs: - job_001 - job_002 @@ -1106,17 +976,21 @@ jobs: - job_017 - job_018 - job_019 - job_026: - name: "e2e_test; linux; PKG: build_runner; `dart test -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1`" + - job_020 + - job_021 + - job_022 + - job_023 + job_025: + name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_11" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test os:ubuntu-latest;pub-cache-hosted;sdk:dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -1127,15 +1001,15 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: build_runner_pub_upgrade - name: build_runner; dart pub upgrade + - id: _test_pub_upgrade + name: _test; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: build_runner - - name: "build_runner; dart test -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1" - run: "dart test -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1" - if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" - working-directory: build_runner + working-directory: _test + - name: "_test; dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random" + run: "dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random" + if: "always() && steps._test_pub_upgrade.conclusion == 'success'" + working-directory: _test needs: - job_001 - job_002 @@ -1156,17 +1030,21 @@ jobs: - job_017 - job_018 - job_019 - job_027: - name: "e2e_test; linux; PKG: build_runner; `dart test -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1`" + - job_020 + - job_021 + - job_022 + - job_023 + job_026: + name: "e2e_test; linux; PKG: _test; `dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner;commands:test_12" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test;commands:test_2" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:build_runner + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test os:ubuntu-latest;pub-cache-hosted;sdk:dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -1177,15 +1055,15 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - id: build_runner_pub_upgrade - name: build_runner; dart pub upgrade + - id: _test_pub_upgrade + name: _test; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: build_runner - - name: "build_runner; dart test -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1" - run: "dart test -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1" - if: "always() && steps.build_runner_pub_upgrade.conclusion == 'success'" - working-directory: build_runner + working-directory: _test + - name: "_test; dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random" + run: "dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random" + if: "always() && steps._test_pub_upgrade.conclusion == 'success'" + working-directory: _test needs: - job_001 - job_002 @@ -1206,7 +1084,11 @@ jobs: - job_017 - job_018 - job_019 - job_028: + - job_020 + - job_021 + - job_022 + - job_023 + job_027: name: "e2e_test; windows; PKG: _test; `dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random`" runs-on: windows-latest steps: @@ -1246,7 +1128,11 @@ jobs: - job_017 - job_018 - job_019 - job_029: + - job_020 + - job_021 + - job_022 + - job_023 + job_028: name: "e2e_test; windows; PKG: _test; `dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random`" runs-on: windows-latest steps: @@ -1286,7 +1172,11 @@ jobs: - job_017 - job_018 - job_019 - job_030: + - job_020 + - job_021 + - job_022 + - job_023 + job_029: name: "e2e_test; windows; PKG: _test; `dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random`" runs-on: windows-latest steps: @@ -1326,3 +1216,7 @@ jobs: - job_017 - job_018 - job_019 + - job_020 + - job_021 + - job_022 + - job_023 diff --git a/build_daemon/CHANGELOG.md b/build_daemon/CHANGELOG.md index 6ff38925da..3a330fdb39 100644 --- a/build_daemon/CHANGELOG.md +++ b/build_daemon/CHANGELOG.md @@ -2,6 +2,7 @@ - Bump the min SDK to 3.7.0. - Remove unused dep: `analyzer`. +- Add `connectUnchecked` for use in tests. ## 4.0.4 diff --git a/build_daemon/lib/client.dart b/build_daemon/lib/client.dart index f1d9a49736..9f9783ed61 100644 --- a/build_daemon/lib/client.dart +++ b/build_daemon/lib/client.dart @@ -169,6 +169,9 @@ class BuildDaemonClient { /// Connects to the current daemon instance. /// + /// The options of the running daemon are checked against [daemonCommand]. + /// If there is a mismatch, an exception is thrown. + /// /// If one is not running, a new daemon instance will be started. static Future connect( String workingDirectory, @@ -180,8 +183,6 @@ class BuildDaemonClient { BuildMode buildMode = BuildMode.Auto, }) async { logHandler ??= (_) {}; - final daemonSerializers = serializersOverride ?? serializers; - final daemonArgs = daemonCommand.sublist(1) ..add('--$buildModeFlag=$buildMode'); @@ -196,6 +197,26 @@ class BuildDaemonClient { await _handleDaemonStartup(process, logHandler); + return connectUnchecked( + workingDirectory, + serializersOverride: serializersOverride, + logHandler: logHandler, + ); + } + + /// Connects to the current daemon instance. + /// + /// Does not check the options the daemon is running with, so this is + /// primarily useful in tests where the daemon has just been launched. + /// + /// To connect and check the options, use [connect]. + static Future connectUnchecked( + String workingDirectory, { + Serializers? serializersOverride, + void Function(ServerLog)? logHandler, + }) async { + logHandler ??= (_) {}; + final daemonSerializers = serializersOverride ?? serializers; return BuildDaemonClient._( await _existingPort(workingDirectory), daemonSerializers, diff --git a/build_runner/dart_test.yaml b/build_runner/dart_test.yaml index 6c74d4c58b..4c4175cca7 100644 --- a/build_runner/dart_test.yaml +++ b/build_runner/dart_test.yaml @@ -3,9 +3,11 @@ presets: include_tags: experiments tags: - slow: - timeout: 16x - integration: + integration1: + timeout: 4x + integration2: + timeout: 4x + integration3: timeout: 4x experiments: skip: 'Only ran if `-P experiments` is passed' diff --git a/build_runner/mono_pkg.yaml b/build_runner/mono_pkg.yaml index 87b91785cd..ed9a3f1564 100644 --- a/build_runner/mono_pkg.yaml +++ b/build_runner/mono_pkg.yaml @@ -9,17 +9,19 @@ stages: - format - analyze: --fatal-infos . - unit_test: - - test: -x integration -x slow --test-randomize-ordering-seed=random + - test: -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random - test: -P experiments --test-randomize-ordering-seed=random - - test: -t integration --test-randomize-ordering-seed=random + - test: -t integration1 --test-randomize-ordering-seed=random + os: + - linux + - windows + - test: -t integration2 --test-randomize-ordering-seed=random + os: + - linux + - windows + - test: -t integration3 --test-randomize-ordering-seed=random os: - linux - windows - leak_check: - command: ../tool/leak_check.sh -- e2e_test: - - test: -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1 - - test: -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1 - - test: -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1 - - test: -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1 - - test: -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1 diff --git a/build_runner/test/commands/daemon/daemon_test.dart b/build_runner/test/commands/daemon/daemon_test.dart deleted file mode 100644 index 3ec5e94958..0000000000 --- a/build_runner/test/commands/daemon/daemon_test.dart +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// TODO(davidmorgan): speed up. -@Tags(['slow']) -library; - -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -import 'package:build_daemon/client.dart'; -import 'package:build_daemon/constants.dart'; -import 'package:build_daemon/data/build_status.dart'; -import 'package:build_daemon/data/build_target.dart'; -import 'package:build_daemon/data/shutdown_notification.dart'; -import 'package:build_runner/src/commands/daemon/constants.dart'; -import 'package:build_runner/src/constants.dart' show dartBinary; -import 'package:path/path.dart' as p; -import 'package:test/test.dart'; -import 'package:test_descriptor/test_descriptor.dart' as d; - -import '../../common/common.dart'; - -void main() { - Process? daemonProcess; - Stream? stdoutLines; - String workspace() => p.join(d.sandbox, 'a'); - final webTarget = DefaultBuildTarget( - (b) => - b - ..target = 'web' - ..reportChangedAssets = true, - ); - final testTarget = DefaultBuildTarget((b) => b..target = 'test'); - final clients = []; - - setUp(() async { - await d.dir('a', [ - await pubspec( - 'a', - currentIsolateDependencies: [ - 'build', - 'build_config', - 'build_daemon', - 'build_modules', - 'build_runner', - 'build_test', - 'build_web_compilers', - 'code_builder', - 'test', - ], - ), - d.dir('test', [ - d.file('hello.dart', ''' -main() { - // Don't actually use test package to speed up tests - print('hello'); -}'''), - ]), - d.dir('lib', [ - d.file('message.dart', ''' -const message = 'hello world'; - '''), - ]), - d.dir('web', [ - d.file('main.dart', ''' -import 'package:a/message.dart'; - -main() { - print(message); -}'''), - ]), - ]).create(); - - await pubGet('a', offline: false); - - // We use `addTearDown` to ensure this runs before the temp dir gets - // cleaned up, otherwise there is a race condition that causes flaky tests. - addTearDown(() async { - for (final client in clients) { - await client.close(); - } - clients.clear(); - stdoutLines = null; - daemonProcess?.kill(ProcessSignal.sigkill); - await daemonProcess?.exitCode; - }); - }); - - Future startClient({ - BuildMode buildMode = BuildMode.Auto, - List options = const [], - }) { - final args = ['run', 'build_runner', 'daemon', ...options]; - printOnFailure('Starting client in: ${workspace()}'); - return BuildDaemonClient.connect( - workspace(), - [dartBinary, ...args], - logHandler: (log) => printOnFailure('Client: ${log.message}'), - buildMode: buildMode, - ); - } - - Future startDaemon({ - BuildMode buildMode = BuildMode.Auto, - List options = const [], - bool expectFailure = false, - }) async { - final args = [ - 'build_runner', - 'daemon', - '--$buildModeFlag=$buildMode', - ...options, - ]; - printOnFailure('Starting daemon in: ${workspace()}'); - final daemon = daemonProcess = await startPub('a', 'run', args: args); - stdoutLines = - daemon.stdout - .transform(const Utf8Decoder()) - .transform(const LineSplitter()) - .asBroadcastStream() - ..listen((line) { - printOnFailure('Daemon: $line'); - }); - daemon.stderr - .transform(const Utf8Decoder()) - .transform(const LineSplitter()) - .listen((line) { - printOnFailure('Daemon Error: $line'); - }); - unawaited( - daemon.exitCode.then((exitCode) { - printOnFailure('GOT EXIT CODE: $exitCode'); - }), - ); - if (expectFailure) { - expect(await daemon.exitCode, isNot(0)); - } else { - expect(await stdoutLines!.contains(readyToConnectLog), isTrue); - } - } - - group('Build Daemon', () { - test('successfully starts', () async { - await startDaemon(); - }); - - test( - 'shuts down on build script change', - skip: 'https://github.com/dart-lang/build/issues/3438', - () async { - await startDaemon(); - final client = - await startClient() - ..registerBuildTarget(webTarget) - ..startBuild(); - // We need to add a listener otherwise we won't get the event. - unawaited(expectLater(client.shutdownNotifications.first, isNotNull)); - // Force a build script change. - await d.dir('a', [ - d.dir('.dart_tool', [ - d.dir('build', [ - d.dir('entrypoint', [d.file('build.dart', '\n')]), - ]), - ]), - ]).create(); - }, - ); - - test('supports --enable-experiment option', () async { - // TODO: Check for specific message about a bad experiment - await startDaemon( - options: ['--enable-experiment=fake-experiment'], - expectFailure: true, - ); - }); - - test( - 'does not shut down down on build script change when configured', - () async { - await startDaemon(options: ['--skip-build-script-check']); - final client = - await startClient(options: ['--skip-build-script-check']) - ..registerBuildTarget(webTarget) - ..startBuild(); - clients.add(client); - ShutdownNotification? notification; - // We need to add a listener otherwise we won't get the event. - unawaited( - client.shutdownNotifications.first.then( - (value) => notification = value, - ), - ); - // Force a build script change. - await d.dir('a', [ - d.dir('.dart_tool', [ - d.dir('build', [ - d.dir('entrypoint', [d.file('build.dart', '\n')]), - ]), - ]), - ]).create(); - // Give time for the notification to propogate if there was one. - await Future.delayed(const Duration(seconds: 4)); - expect(notification, isNull); - }, - ); - - test('errors if build modes conflict', () async { - await startDaemon(); - expect( - startClient(buildMode: BuildMode.Manual), - throwsA(const TypeMatcher()), - ); - }); - - test('can build in manual mode', () async { - await startDaemon(buildMode: BuildMode.Manual); - final client = - await startClient(buildMode: BuildMode.Manual) - ..registerBuildTarget(webTarget) - ..startBuild(); - clients.add(client); - expect( - client.buildResults, - emitsThrough( - (BuildResults b) => b.results.first.status == BuildStatus.succeeded, - ), - ); - }); - - test('auto build mode automatically builds on file change', () async { - await startDaemon(); - final client = - await startClient() - ..registerBuildTarget(webTarget); - clients.add(client); - // Let the target request propagate. - await Future.delayed(const Duration(seconds: 2)); - // Trigger a file change. - await d.dir('a', [ - d.dir('web', [ - d.file('main.dart', ''' -main() { - print('goodbye world'); -}'''), - ]), - ]).create(); - expect( - client.buildResults, - emitsThrough( - (BuildResults b) => b.results.first.status == BuildStatus.succeeded, - ), - ); - }); - - test( - 'manual build mode does not automatically build on file change', - () async { - await startDaemon(buildMode: BuildMode.Manual); - final client = await startClient(buildMode: BuildMode.Manual) - ..registerBuildTarget(webTarget); - clients.add(client); - // Let the target request propagate. - await Future.delayed(const Duration(seconds: 2)); - // Trigger a file change. - await d.dir('a', [ - d.dir('web', [ - d.file('main.dart', ''' -// @dart=2.12 -main() { - print('goodbye world'); -}'''), - ]), - ]).create(); - // There shouldn't be any build results. - final buildResults = await client.buildResults.first - .then((r) => r) - .timeout(const Duration(seconds: 2), onTimeout: () => null); - expect(buildResults, isNull); - client.startBuild(); - final startedResult = await client.buildResults.first; - expect( - startedResult.results.first.status, - BuildStatus.started, - reason: 'Should do a build once requested', - ); - final succeededResult = await client.buildResults.first; - expect(succeededResult.results.first.status, BuildStatus.succeeded); - final ddcContent = - await File( - p.join( - d.sandbox, - 'a', - '.dart_tool', - 'build', - 'generated', - 'a', - 'web', - 'main.ddc.js', - ), - ).readAsString(); - expect(ddcContent, contains('goodbye world')); - }, - ); - - test('can build to outputs', () async { - final outputDir = Directory(p.join(d.sandbox, 'a', 'deploy')); - expect(outputDir.existsSync(), isFalse); - await startDaemon(); - // Start the client with the same options to prevent OptionSkew. - // In the future this should be an option on the target. - final client = - await startClient() - ..registerBuildTarget( - DefaultBuildTarget( - (b) => - b - ..target = 'web' - ..outputLocation = - OutputLocation( - (b) => - b - ..output = 'deploy' - ..hoist = true - ..useSymlinks = false, - ).toBuilder(), - ), - ) - ..startBuild(); - clients.add(client); - await client.buildResults.firstWhere( - (b) => b.results.first.status == BuildStatus.succeeded, - ); - expect(outputDir.existsSync(), isTrue); - }); - - test('writes the asset server port', () async { - await startDaemon(); - expect(File(assetServerPortFilePath(workspace())).existsSync(), isTrue); - }); - - test('notifies upon build start', () async { - await startDaemon(); - final client = - await startClient() - ..registerBuildTarget(webTarget) - ..startBuild(); - clients.add(client); - expect( - client.buildResults, - emitsThrough( - (BuildResults b) => b.results.first.status == BuildStatus.started, - ), - ); - // Wait for the build to finish before exiting to prevent flakiness. - expect( - client.buildResults, - emitsThrough( - (BuildResults b) => b.results.first.status == BuildStatus.succeeded, - ), - ); - }); - - test('can complete builds', () async { - await startDaemon(); - final client = - await startClient() - ..registerBuildTarget(webTarget) - ..startBuild(); - clients.add(client); - - expect( - client.buildResults, - emitsThrough( - isA() - .having( - (e) => e.results.first.status, - 'results.first.status', - BuildStatus.succeeded, - ) - .having( - (e) => e.changedAssets, - 'changedAsssets', - contains(Uri.parse('asset:a/web/main.dart.js')), - ), - ), - ); - }); - - test('allows multiple clients to connect and build', () async { - await startDaemon(); - - final clientA = await startClient(); - clientA.registerBuildTarget(webTarget); - clients.add(clientA); - - final clientB = - await startClient() - ..registerBuildTarget(testTarget) - ..startBuild(); - clients.add(clientB); - - // Both clients should be notified. - await clientA.buildResults.first; - final buildResultsB = await clientB.buildResults.firstWhere( - (b) => b.results.first.status != BuildStatus.started, - ); - - expect(buildResultsB.results.first.status, BuildStatus.succeeded); - expect(buildResultsB.results.length, equals(2)); - }); - - group('build filters', () { - setUp(() async { - // Adds an additional entrypoint. - await d.dir('a', [ - d.dir('web', [ - d.file('other.dart', ''' -main() { - print('goodbye world'); -}'''), - ]), - ]).create(); - }); - - test('can build specific outputs', () async { - await startDaemon(buildMode: BuildMode.Manual); - final client = - await startClient(buildMode: BuildMode.Manual) - ..registerBuildTarget( - DefaultBuildTarget( - (b) => - b - ..target = 'web' - ..buildFilters.add('web/other.dart.js'), - ), - ) - ..startBuild(); - clients.add(client); - await client.buildResults.firstWhere( - (b) => b.results.first.status == BuildStatus.succeeded, - ); - - await d.dir('a', [ - d.dir('.dart_tool', [ - d.dir('build', [ - d.dir('generated', [ - d.dir('a', [ - d.dir('web', [ - d.file('other.dart.js', isNotEmpty), - d.nothing('main.dart.js'), - ]), - ]), - ]), - ]), - ]), - ]).validate(); - }); - }); - }); -} diff --git a/build_runner/test/commands/serve/serve_integration_test.dart b/build_runner/test/commands/serve/serve_integration_test.dart index f07318be99..243bb6c0b2 100644 --- a/build_runner/test/commands/serve/serve_integration_test.dart +++ b/build_runner/test/commands/serve/serve_integration_test.dart @@ -2,10 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// TODO(davidmorgan): speed up. -@Tags(['slow']) -library; - import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/build_runner/test/common/build_runner_tester.dart b/build_runner/test/common/build_runner_tester.dart index 0b7e83d500..47b86cbda0 100644 --- a/build_runner/test/common/build_runner_tester.dart +++ b/build_runner/test/common/build_runner_tester.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'dart:io'; import 'dart:isolate'; +import 'package:async/async.dart'; import 'package:build_runner/src/logging/build_log.dart'; import 'package:package_config/package_config.dart'; import 'package:path/path.dart' as p; @@ -176,12 +177,16 @@ ${result.stdout}${result.stderr}=== /// A running `build_runner` process. class BuildRunnerProcess { final TestProcess process; + final StreamQueue _outputs; late final HttpClient _client = HttpClient(); int? _port; - BuildRunnerProcess(this.process); + BuildRunnerProcess(this.process) + : _outputs = StreamQueue( + StreamGroup.merge([process.stdoutStream(), process.stderrStream()]), + ); - /// Expects [pattern] to appear in the process's stdout. + /// Expects [pattern] to appear in the process's stdout or stderr. /// /// If [failOn] is encountered instead, the test fails immediately. It /// defaults to [BuildLog.failurePattern] so that `expect` will stop if the @@ -195,7 +200,7 @@ class BuildRunnerProcess { while (true) { String? line; try { - line = await process.stdout.next; + line = await _outputs.next; } catch (_) { throw fail('While expecting `$pattern`, process exited.'); } diff --git a/build_runner/test/common/common.dart b/build_runner/test/common/common.dart index 3b5e1bd8a4..35430079bf 100644 --- a/build_runner/test/common/common.dart +++ b/build_runner/test/common/common.dart @@ -12,11 +12,9 @@ export 'package:build_test/src/internal_test_reader_writer.dart'; export 'build_runner_tester.dart'; export 'builders.dart'; -export 'descriptors.dart'; export 'fixture_packages.dart'; export 'matchers.dart'; export 'package_graphs.dart'; -export 'sdk.dart'; export 'test_phases.dart'; Digest computeDigest(AssetId id, String contents) { diff --git a/build_runner/test/common/descriptors.dart b/build_runner/test/common/descriptors.dart deleted file mode 100644 index d08a1135d4..0000000000 --- a/build_runner/test/common/descriptors.dart +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; -import 'dart:isolate'; - -import 'package:package_config/package_config.dart'; -import 'package:test_descriptor/test_descriptor.dart' as d; - -/// Creates a `pubspec.yaml` file for package [name]. -/// -/// If [currentIsolateDependencies] is provided then it will add a path -/// dependency for each package listed, assuming it can be resolved in the -/// current isolate. -/// -/// If [pathDependencies] is provided then the keys are the package names -/// and the values are the exact paths which will be added as a dependency. -/// -/// If [versionDependencies] is provided then the keys are the package names -/// and the values are the exact versions which will be added as a dependency. -/// -/// The [sdkEnvironment] describes the `environment.sdk` field in the pubspec. -Future pubspec( - String name, { - Iterable currentIsolateDependencies = const [], - Map pathDependencies = const {}, - Map versionDependencies = const {}, - String sdkEnvironment = '>=2.12.0 <4.0.0', -}) async { - final buffer = - StringBuffer() - ..writeln('name: $name') - ..writeln('environment:') - ..writeln(' sdk: "$sdkEnvironment"') - ..writeln('dependencies:'); - - // Add all deps as `any` deps, real versions are set in dependency_overrides - // below. - final allPackages = [ - ...currentIsolateDependencies, - ...pathDependencies.keys, - ...versionDependencies.keys, - ]; - for (final package in allPackages) { - buffer.writeln(' $package: any'); - } - - // Using dependency_overrides forces the path dependency and silences - // warnings about hosted vs path dependency conflicts. - buffer.writeln('dependency_overrides:'); - - final packageConfig = await loadPackageConfigUri( - (await Isolate.packageConfig)!, - ); - - void addPathDep(String package, String path) { - buffer - ..writeln(' $package:') - ..writeln(' path: $path'); - } - - await Future.forEach(currentIsolateDependencies, (String package) async { - addPathDep(package, packageConfig[package]!.root.toFilePath()); - }); - - pathDependencies.forEach(addPathDep); - - versionDependencies.forEach((package, version) { - buffer.writeln(' $package: $version'); - }); - - return d.file('pubspec.yaml', buffer.toString()); -} diff --git a/build_runner/test/common/matchers.dart b/build_runner/test/common/matchers.dart index 052329bcf7..37d9c956ab 100644 --- a/build_runner/test/common/matchers.dart +++ b/build_runner/test/common/matchers.dart @@ -2,9 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore: implementation_imports import 'package:build_runner/src/build/asset_graph/graph.dart'; -// ignore: implementation_imports import 'package:build_runner/src/build/asset_graph/node.dart'; import 'package:test/test.dart'; diff --git a/build_runner/test/common/package_graphs.dart b/build_runner/test/common/package_graphs.dart index e9e1d4d956..c54765d094 100644 --- a/build_runner/test/common/package_graphs.dart +++ b/build_runner/test/common/package_graphs.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore: implementation_imports import 'package:build_runner/src/internal.dart'; import 'package:package_config/package_config.dart'; diff --git a/build_runner/test/common/sdk.dart b/build_runner/test/common/sdk.dart deleted file mode 100644 index 359aa1bd55..0000000000 --- a/build_runner/test/common/sdk.dart +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; - -// ignore: implementation_imports -import 'package:build_runner/src/constants.dart'; -import 'package:path/path.dart' as p; -import 'package:test/test.dart'; -import 'package:test_descriptor/test_descriptor.dart' as d; - -/// Runs `pub get` on [package] (which is assumed to be in a directory with -/// that name under the [d.sandbox] directory). -Future pubGet(String package, {bool offline = true}) async { - final pubGetresult = await runPub( - package, - 'get', - args: offline ? ['--offline'] : [], - ); - expect(pubGetresult.exitCode, 0, reason: pubGetresult.stderr as String); - return pubGetresult; -} - -/// Runs the `pub` [command] on [package] with [args]. -Future runPub( - String package, - String command, { - Iterable? args, -}) => Process.run(dartBinary, [ - if (command != 'run') 'pub', // `dart run` is the new `pub run` - command, - ...?args, -], workingDirectory: p.join(d.sandbox, package)); - -/// Starts the `pub` [command] on [package] with [args]. -Future startPub( - String package, - String command, { - Iterable? args, -}) => Process.start(dartBinary, [ - if (command != 'run') 'pub', // `dart run` is the new `pub run`, - command, ...?args, -], workingDirectory: p.join(d.sandbox, package)); - -/// Runs the `dart` script [script] in [package] with [args]. -/// -/// The [script] should be a relative path under [package]. -Future runDart( - String package, - String script, { - Iterable? args, -}) => Process.run(dartBinary, [ - script, - ...?args, -], workingDirectory: p.join(d.sandbox, package)); diff --git a/build_runner/test/integration_tests/build_command_build_filter_test.dart b/build_runner/test/integration_tests/build_command_build_filter_test.dart index 670dcaefe9..0931a0267f 100644 --- a/build_runner/test/integration_tests/build_command_build_filter_test.dart +++ b/build_runner/test/integration_tests/build_command_build_filter_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration1']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/build_command_config_validation_test.dart b/build_runner/test/integration_tests/build_command_config_validation_test.dart index e4af26b677..19fe8634b1 100644 --- a/build_runner/test/integration_tests/build_command_config_validation_test.dart +++ b/build_runner/test/integration_tests/build_command_config_validation_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration1']) library; import 'package:io/io.dart'; diff --git a/build_runner/test/integration_tests/build_command_define_test.dart b/build_runner/test/integration_tests/build_command_define_test.dart index cb93e9e21c..14f1bcfd1d 100644 --- a/build_runner/test/integration_tests/build_command_define_test.dart +++ b/build_runner/test/integration_tests/build_command_define_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration1']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/build_command_errors_test.dart b/build_runner/test/integration_tests/build_command_errors_test.dart index 81dd0b1a5f..883ce52fc2 100644 --- a/build_runner/test/integration_tests/build_command_errors_test.dart +++ b/build_runner/test/integration_tests/build_command_errors_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration1']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/build_command_find_assets_test.dart b/build_runner/test/integration_tests/build_command_find_assets_test.dart index 26b134be60..660abfde15 100644 --- a/build_runner/test/integration_tests/build_command_find_assets_test.dart +++ b/build_runner/test/integration_tests/build_command_find_assets_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration1']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/build_command_invalidation_test.dart b/build_runner/test/integration_tests/build_command_invalidation_test.dart index 77fed4693e..4707e8dfeb 100644 --- a/build_runner/test/integration_tests/build_command_invalidation_test.dart +++ b/build_runner/test/integration_tests/build_command_invalidation_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration2']) library; import 'package:build_runner/src/bootstrap/build_script_generate.dart'; diff --git a/build_runner/test/integration_tests/build_command_output_only_required_test.dart b/build_runner/test/integration_tests/build_command_output_only_required_test.dart index eadb1defe1..de2c628954 100644 --- a/build_runner/test/integration_tests/build_command_output_only_required_test.dart +++ b/build_runner/test/integration_tests/build_command_output_only_required_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration2']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/build_command_output_test.dart b/build_runner/test/integration_tests/build_command_output_test.dart index 0532948c71..39774a10ee 100644 --- a/build_runner/test/integration_tests/build_command_output_test.dart +++ b/build_runner/test/integration_tests/build_command_output_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration2']) library; import 'package:io/io.dart'; diff --git a/build_runner/test/integration_tests/clean_command_test.dart b/build_runner/test/integration_tests/clean_command_test.dart index 445c506661..6051165e48 100644 --- a/build_runner/test/integration_tests/clean_command_test.dart +++ b/build_runner/test/integration_tests/clean_command_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration2']) library; import 'package:test/test.dart'; diff --git a/build_runner/test/integration_tests/daemon_command_test.dart b/build_runner/test/integration_tests/daemon_command_test.dart new file mode 100644 index 0000000000..dbe70c74d3 --- /dev/null +++ b/build_runner/test/integration_tests/daemon_command_test.dart @@ -0,0 +1,212 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +@Tags(['integration2']) +library; + +import 'dart:io'; + +import 'package:async/async.dart'; +import 'package:build_daemon/client.dart'; +import 'package:build_daemon/constants.dart'; +import 'package:build_daemon/data/build_status.dart'; +import 'package:build_daemon/data/build_target.dart'; +import 'package:build_runner/src/commands/daemon/constants.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +import '../common/common.dart'; + +void main() async { + final webTarget = DefaultBuildTarget((b) { + b.target = 'web'; + b.reportChangedAssets = true; + }); + + test('daemon command', () async { + final pubspecs = await Pubspecs.load(); + final tester = BuildRunnerTester(pubspecs); + + tester.writeFixturePackage(FixturePackages.copyBuilder()); + + tester.writePackage( + name: 'root_pkg', + dependencies: [ + 'build', + 'build_config', + 'build_daemon', + 'build_modules', + 'build_runner', + 'build_web_compilers', + 'build_test', + ], + pathDependencies: ['builder_pkg'], + files: { + 'lib/message.dart': "const message = 'hello world';", + 'web/main.dart': ''' +import 'package:root_pkg/message.dart'; + +void main() { + print(message); +} +''', + 'test/hello.dart': ''' +void main() { + print('hello'); +} +''', + }, + ); + + // Invalid options. + var daemon = await tester.start( + 'root_pkg', + 'dart run build_runner daemon --enable-experiment=bad-experiment', + ); + await daemon.expect('Failed to compile build script.'); + + // Start daemon in default "auto" mode that watches files. + daemon = await tester.start('root_pkg', 'dart run build_runner daemon'); + await daemon.expect(readyToConnectLog); + + // Writes the asset server port. + expect( + File( + assetServerPortFilePath(p.join(tester.tempDirectory.path, 'root_pkg')), + ).existsSync(), + true, + ); + + // Start with different option gives an error. + final differentOptionsDaemon = await tester.start( + 'root_pkg', + 'dart run build_runner daemon --build-mode=BuildMode.Manual', + ); + await differentOptionsDaemon.expect(optionsSkew); + + // Start client. + var client = await BuildDaemonClient.connectUnchecked( + p.join(tester.tempDirectory.path, 'root_pkg'), + ); + addTearDown(client.close); + + // Builds. + client.registerBuildTarget(webTarget); + client.startBuild(); + var results = StreamQueue(client.buildResults); + expect((await results.next).results.single.status, BuildStatus.started); + expect((await results.next).results.single.status, BuildStatus.succeeded); + + // File change causes a build; input and output changes are reported. + tester.update('root_pkg/lib/message.dart', (script) => '$script\n'); + expect((await results.next).results.single.status, BuildStatus.started); + final result = await results.next; + expect(result.results.single.status, BuildStatus.succeeded); + expect( + result.changedAssets, + allOf([ + contains(Uri.parse('package:root_pkg/message.dart')), + contains(Uri.parse('package:root_pkg/message.ddc.js')), + ]), + ); + + // Builder change causes shutdown. + final shutdownNotificationFuture = client.shutdownNotifications.first; + tester.update('builder_pkg/lib/builder.dart', (script) => '$script\n'); + final shutdownNotification = await shutdownNotificationFuture.timeout( + const Duration(seconds: 4), + ); + expect( + shutdownNotification.message, + 'Build script updated. Shutting down the Build Daemon.', + ); + await client.close(); + + // Now a daemon in manual mode. + await daemon.kill(); + daemon = await tester.start( + 'root_pkg', + 'dart run build_runner daemon --build-mode=BuildMode.Manual', + ); + await daemon.expect(readyToConnectLog); + + // Builds. + client = await BuildDaemonClient.connectUnchecked( + p.join(tester.tempDirectory.path, 'root_pkg'), + ); + addTearDown(client.close); + client.registerBuildTarget(webTarget); + client.startBuild(); + results = StreamQueue(client.buildResults); + expect((await results.next).results.single.status, BuildStatus.started); + expect((await results.next).results.single.status, BuildStatus.succeeded); + + // File change does not cause a build. + tester.update('root_pkg/lib/message.dart', (script) => '$script\n'); + expect( + await results.next + .then((status) => status) + .timeout(const Duration(seconds: 2), onTimeout: () => null), + null, + ); + + // The next test needs a fresh daemon so cause this one to close by changing + // the builder. + tester.update('builder_pkg/lib/builder.dart', (script) => '$script\n'); + client.startBuild(); + await client.shutdownNotifications.first; + await client.close(); + + // Create new entrypoints to test building with a build filter. + tester.write('root_pkg/web/main2.dart', "void main() { print('hi'); }"); + tester.write('root_pkg/web/main3.dart', "void main() {print('hi'); }"); + + // Start a new daemon, connect to it. + daemon = await tester.start( + 'root_pkg', + 'dart run build_runner daemon --build-mode=BuildMode.Manual', + ); + await daemon.expect(readyToConnectLog); + client = await BuildDaemonClient.connectUnchecked( + p.join(tester.tempDirectory.path, 'root_pkg'), + ); + results = StreamQueue(client.buildResults); + addTearDown(client.close); + // Connect to it twice to check both clients are notified later. + final client2 = await BuildDaemonClient.connectUnchecked( + p.join(tester.tempDirectory.path, 'root_pkg'), + ); + final results2 = StreamQueue(client2.buildResults); + addTearDown(client2.close); + + // Configure target with build filter. + final target = DefaultBuildTarget((b) { + b.target = 'web'; + b.buildFilters.add('web/main2.dart.js'); + }); + client.registerBuildTarget(target); + client2.registerBuildTarget(target); + + // Build and check only the expected outputs are generated. + client.startBuild(); + expect((await results.next).results.single.status, BuildStatus.started); + expect((await results.next).results.single.status, BuildStatus.succeeded); + expect( + tester.read( + 'root_pkg/.dart_tool/build/generated/root_pkg/web/main2.dart.js', + ), + isNotNull, + ); + expect( + tester.read( + 'root_pkg/.dart_tool/build/generated/root_pkg/web/main3.dart.js', + ), + null, + ); + + // Check the second client was notified too. + expect((await results2.next).results.single.status, BuildStatus.started); + expect((await results2.next).results.single.status, BuildStatus.succeeded); + }); +} diff --git a/build_runner/test/integration_tests/run_command_test.dart b/build_runner/test/integration_tests/run_command_test.dart index fa2ccceb92..52cab6c99f 100644 --- a/build_runner/test/integration_tests/run_command_test.dart +++ b/build_runner/test/integration_tests/run_command_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration3']) library; import 'package:io/io.dart'; diff --git a/build_runner/test/integration_tests/serve_command_serve_only_required_test.dart b/build_runner/test/integration_tests/serve_command_serve_only_required_test.dart index fe0a8e7ea0..feb3d498a9 100644 --- a/build_runner/test/integration_tests/serve_command_serve_only_required_test.dart +++ b/build_runner/test/integration_tests/serve_command_serve_only_required_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration3']) library; import 'package:build_runner/src/logging/build_log.dart'; diff --git a/build_runner/test/integration_tests/serve_command_test.dart b/build_runner/test/integration_tests/serve_command_test.dart index d35e719152..7caf205962 100644 --- a/build_runner/test/integration_tests/serve_command_test.dart +++ b/build_runner/test/integration_tests/serve_command_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration3']) library; import 'dart:io'; diff --git a/build_runner/test/integration_tests/test_command_test.dart b/build_runner/test/integration_tests/test_command_test.dart index 135744a90a..87211fcc78 100644 --- a/build_runner/test/integration_tests/test_command_test.dart +++ b/build_runner/test/integration_tests/test_command_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration3']) library; import 'package:io/io.dart'; diff --git a/build_runner/test/integration_tests/watch_command_invalidation_test.dart b/build_runner/test/integration_tests/watch_command_invalidation_test.dart index e7e8d0bb24..73181e16c1 100644 --- a/build_runner/test/integration_tests/watch_command_invalidation_test.dart +++ b/build_runner/test/integration_tests/watch_command_invalidation_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -@Tags(['integration']) +@Tags(['integration3']) library; import 'package:build_runner/src/logging/build_log.dart'; diff --git a/tool/ci.sh b/tool/ci.sh index c43fc0456c..6ece3512c0 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -83,57 +83,45 @@ for PKG in ${PKGS}; do echo 'dart format --output=none --set-exit-if-changed .' dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? ;; - test_00) + test_0) echo 'dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random' dart test --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_01) + test_1) echo 'dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random' dart test --total-shards 3 --shard-index 1 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_02) + test_2) echo 'dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random' dart test --total-shards 3 --shard-index 2 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_03) + test_3) echo 'dart test --test-randomize-ordering-seed=random' dart test --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_04) + test_4) echo 'dart test -P presubmit --test-randomize-ordering-seed=random' dart test -P presubmit --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_05) - echo 'dart test -x integration -x slow --test-randomize-ordering-seed=random' - dart test -x integration -x slow --test-randomize-ordering-seed=random || EXIT_CODE=$? + test_5) + echo 'dart test -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random' + dart test -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_06) + test_6) echo 'dart test -P experiments --test-randomize-ordering-seed=random' dart test -P experiments --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_07) - echo 'dart test -t integration --test-randomize-ordering-seed=random' - dart test -t integration --test-randomize-ordering-seed=random || EXIT_CODE=$? + test_7) + echo 'dart test -t integration1 --test-randomize-ordering-seed=random' + dart test -t integration1 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_08) - echo 'dart test -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1' - dart test -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1 || EXIT_CODE=$? + test_8) + echo 'dart test -t integration2 --test-randomize-ordering-seed=random' + dart test -t integration2 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; - test_09) - echo 'dart test -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1' - dart test -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1 || EXIT_CODE=$? - ;; - test_10) - echo 'dart test -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1' - dart test -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1 || EXIT_CODE=$? - ;; - test_11) - echo 'dart test -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1' - dart test -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1 || EXIT_CODE=$? - ;; - test_12) - echo 'dart test -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1' - dart test -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1 || EXIT_CODE=$? + test_9) + echo 'dart test -t integration3 --test-randomize-ordering-seed=random' + dart test -t integration3 --test-randomize-ordering-seed=random || EXIT_CODE=$? ;; *) echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m"