From 63cfcbb7f6411bb02612ffe47b5146ae6ab99651 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Fri, 14 Jun 2024 19:17:29 +0000 Subject: [PATCH 1/8] Add package config URI into VM test entrypoints This will allow a client of the VM service to evaluate the top level variable and locate the package config used by the test runner. --- .../test_core/lib/src/runner/vm/platform.dart | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/pkgs/test_core/lib/src/runner/vm/platform.dart b/pkgs/test_core/lib/src/runner/vm/platform.dart index 85f691d7a..2d141cab8 100644 --- a/pkgs/test_core/lib/src/runner/vm/platform.dart +++ b/pkgs/test_core/lib/src/runner/vm/platform.dart @@ -300,7 +300,10 @@ stderr: ${processResult.stderr}'''); file ..createSync(recursive: true) ..writeAsStringSync(_bootstrapIsolateTestContents( - await absoluteUri(testPath), languageVersionComment)); + testUri: await absoluteUri(testPath), + languageVersionComment: languageVersionComment, + packageConfigUri: await Isolate.packageConfig, + )); } return file.uri; } @@ -317,20 +320,30 @@ stderr: ${processResult.stderr}'''); file ..createSync(recursive: true) ..writeAsStringSync(_bootstrapNativeTestContents( - await absoluteUri(testPath), languageVersionComment)); + testUri: await absoluteUri(testPath), + languageVersionComment: languageVersionComment, + packageConfigUri: await Isolate.packageConfig, + )); } return file.path; } } /// Creates bootstrap file contents for running [testUri] in a VM isolate. -String _bootstrapIsolateTestContents( - Uri testUri, String languageVersionComment) => +String _bootstrapIsolateTestContents({ + required Uri testUri, + required String languageVersionComment, + required Uri? packageConfigUri, +}) => ''' $languageVersionComment - import "dart:isolate"; - import "package:test_core/src/bootstrap/vm.dart"; - import "$testUri" as test; + + import 'dart:isolate'; + import 'package:test_core/src/bootstrap/vm.dart'; + import '$testUri' as test; + + const packageConfigLocation = '$packageConfigUri'; + void main(_, SendPort sendPort) { internalBootstrapVmTest(() => test.main, sendPort); } @@ -338,13 +351,20 @@ String _bootstrapIsolateTestContents( /// Creates bootstrap file contents for running [testUri] as a native /// executable. -String _bootstrapNativeTestContents( - Uri testUri, String languageVersionComment) => +String _bootstrapNativeTestContents({ + required Uri testUri, + required String languageVersionComment, + required Uri? packageConfigUri, +}) => ''' $languageVersionComment - import "dart:isolate"; - import "package:test_core/src/bootstrap/vm.dart"; - import "$testUri" as test; + + import 'dart:isolate'; + import 'package:test_core/src/bootstrap/vm.dart'; + import '$testUri' as test; + + const packageConfigLocation = '$packageConfigUri'; + void main(List args) { internalBootstrapNativeTest(() => test.main, args); } From 9bb4a2cc686feccfba97885ab3f7a87b45bed2e5 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 17 Jun 2024 20:54:12 +0000 Subject: [PATCH 2/8] Add to precompiled tests --- pkgs/test_core/lib/src/runner/vm/test_compiler.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart index c34b4f694..3d482f96d 100644 --- a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart +++ b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'dart:isolate'; import 'package:async/async.dart'; import 'package:frontend_server_client/frontend_server_client.dart'; @@ -85,7 +86,7 @@ class _TestCompilerForLanguageVersion { : _dillCachePath = '$dillCachePrefix.' '${_dillCacheSuffix(_languageVersionComment, enabledExperiments)}'; - String _generateEntrypoint(Uri testUri) { + String _generateEntrypoint(Uri testUri, Uri? packageConfigUri) { return ''' $_languageVersionComment import "dart:isolate"; @@ -94,6 +95,8 @@ class _TestCompilerForLanguageVersion { import "$testUri" as test; + const packageConfigLocation = '$packageConfigUri'; + void main(_, SendPort sendPort) { internalBootstrapVmTest(() => test.main, sendPort); } @@ -108,7 +111,8 @@ class _TestCompilerForLanguageVersion { if (_closeMemo.hasRun) return CompilationResponse._wasShutdown; CompileResult? compilerOutput; final tempFile = File(p.join(_outputDillDirectory.path, 'test.dart')) - ..writeAsStringSync(_generateEntrypoint(mainUri)); + ..writeAsStringSync( + _generateEntrypoint(mainUri, await Isolate.packageConfig)); final testCache = File(_dillCachePath); try { From 726209598a9b8f55891e4382c0372c7f82818ced Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 17 Jun 2024 22:11:49 +0000 Subject: [PATCH 3/8] Move to a shared utility --- .../test_core/lib/src/runner/vm/platform.dart | 47 ++---------------- .../lib/src/runner/vm/test_compiler.dart | 48 +++++++++++-------- 2 files changed, 33 insertions(+), 62 deletions(-) diff --git a/pkgs/test_core/lib/src/runner/vm/platform.dart b/pkgs/test_core/lib/src/runner/vm/platform.dart index 2d141cab8..f32670fa7 100644 --- a/pkgs/test_core/lib/src/runner/vm/platform.dart +++ b/pkgs/test_core/lib/src/runner/vm/platform.dart @@ -299,10 +299,11 @@ stderr: ${processResult.stderr}'''); if (!file.existsSync()) { file ..createSync(recursive: true) - ..writeAsStringSync(_bootstrapIsolateTestContents( + ..writeAsStringSync(testBootstrapContents( testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, packageConfigUri: await Isolate.packageConfig, + bootstrapType: 'Vm', )); } return file.uri; @@ -319,57 +320,17 @@ stderr: ${processResult.stderr}'''); if (!file.existsSync()) { file ..createSync(recursive: true) - ..writeAsStringSync(_bootstrapNativeTestContents( + ..writeAsStringSync(testBootstrapContents( testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, packageConfigUri: await Isolate.packageConfig, + bootstrapType: 'Native', )); } return file.path; } } -/// Creates bootstrap file contents for running [testUri] in a VM isolate. -String _bootstrapIsolateTestContents({ - required Uri testUri, - required String languageVersionComment, - required Uri? packageConfigUri, -}) => - ''' - $languageVersionComment - - import 'dart:isolate'; - import 'package:test_core/src/bootstrap/vm.dart'; - import '$testUri' as test; - - const packageConfigLocation = '$packageConfigUri'; - - void main(_, SendPort sendPort) { - internalBootstrapVmTest(() => test.main, sendPort); - } - '''; - -/// Creates bootstrap file contents for running [testUri] as a native -/// executable. -String _bootstrapNativeTestContents({ - required Uri testUri, - required String languageVersionComment, - required Uri? packageConfigUri, -}) => - ''' - $languageVersionComment - - import 'dart:isolate'; - import 'package:test_core/src/bootstrap/vm.dart'; - import '$testUri' as test; - - const packageConfigLocation = '$packageConfigUri'; - - void main(List args) { - internalBootstrapNativeTest(() => test.main, args); - } - '''; - Future> _gatherCoverage(Environment environment) async { final isolateId = Uri.parse(environment.observatoryUrl!.fragment) .queryParameters['isolateId']; diff --git a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart index 3d482f96d..0b240cebf 100644 --- a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart +++ b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart @@ -86,23 +86,6 @@ class _TestCompilerForLanguageVersion { : _dillCachePath = '$dillCachePrefix.' '${_dillCacheSuffix(_languageVersionComment, enabledExperiments)}'; - String _generateEntrypoint(Uri testUri, Uri? packageConfigUri) { - return ''' - $_languageVersionComment - import "dart:isolate"; - - import "package:test_core/src/bootstrap/vm.dart"; - - import "$testUri" as test; - - const packageConfigLocation = '$packageConfigUri'; - - void main(_, SendPort sendPort) { - internalBootstrapVmTest(() => test.main, sendPort); - } - '''; - } - Future compile(Uri mainUri) => _compilePool.withResource(() => _compile(mainUri)); @@ -111,8 +94,12 @@ class _TestCompilerForLanguageVersion { if (_closeMemo.hasRun) return CompilationResponse._wasShutdown; CompileResult? compilerOutput; final tempFile = File(p.join(_outputDillDirectory.path, 'test.dart')) - ..writeAsStringSync( - _generateEntrypoint(mainUri, await Isolate.packageConfig)); + ..writeAsStringSync(testBootstrapContents( + testUri: mainUri, + packageConfigUri: await Isolate.packageConfig, + languageVersionComment: _languageVersionComment, + bootstrapType: 'Vm', + )); final testCache = File(_dillCachePath); try { @@ -215,3 +202,26 @@ String _dillCacheSuffix( } return base64.encode(utf8.encode(identifierString.toString())); } + +/// Creates bootstrap file contents for running [testUri] in a VM isolate. +String testBootstrapContents({ + required Uri testUri, + required String languageVersionComment, + required Uri? packageConfigUri, + required String bootstrapType, +}) => + ''' + $languageVersionComment + + import 'dart:isolate'; + + import 'package:test_core/src/bootstrap/vm.dart'; + + import '$testUri' as test; + + const packageConfigLocation = '$packageConfigUri'; + + void main(_, SendPort sendPort) { + internalBootstrap${bootstrapType}Test(() => test.main, sendPort); + } + '''; From 692d9dd96970b8f5f16467e402b16a81c44f2775 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 17 Jun 2024 22:14:16 +0000 Subject: [PATCH 4/8] Fix the doc comment --- pkgs/test_core/lib/src/runner/vm/test_compiler.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart index 0b240cebf..cf5ccddc1 100644 --- a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart +++ b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart @@ -203,7 +203,10 @@ String _dillCacheSuffix( return base64.encode(utf8.encode(identifierString.toString())); } -/// Creates bootstrap file contents for running [testUri] in a VM isolate. +/// Creates bootstrap file contents for running [testUri]. +/// +/// The [bootstrapType] argument should be either 'Vm' or 'Native' depending on +/// which `internalBootstrap*Test` function should be used. String testBootstrapContents({ required Uri testUri, required String languageVersionComment, From dcf2998a18dccaf529b668bd060081f26178499b Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 17 Jun 2024 22:24:45 +0000 Subject: [PATCH 5/8] Don't conflate arguments between templates --- .../test_core/lib/src/runner/vm/platform.dart | 4 ++-- .../lib/src/runner/vm/test_compiler.dart | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/test_core/lib/src/runner/vm/platform.dart b/pkgs/test_core/lib/src/runner/vm/platform.dart index f32670fa7..4e3b070f9 100644 --- a/pkgs/test_core/lib/src/runner/vm/platform.dart +++ b/pkgs/test_core/lib/src/runner/vm/platform.dart @@ -303,7 +303,7 @@ stderr: ${processResult.stderr}'''); testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, packageConfigUri: await Isolate.packageConfig, - bootstrapType: 'Vm', + testType: VmTestType.isolate, )); } return file.uri; @@ -324,7 +324,7 @@ stderr: ${processResult.stderr}'''); testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, packageConfigUri: await Isolate.packageConfig, - bootstrapType: 'Native', + testType: VmTestType.process, )); } return file.path; diff --git a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart index cf5ccddc1..a4e3f2d46 100644 --- a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart +++ b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart @@ -98,7 +98,7 @@ class _TestCompilerForLanguageVersion { testUri: mainUri, packageConfigUri: await Isolate.packageConfig, languageVersionComment: _languageVersionComment, - bootstrapType: 'Vm', + testType: VmTestType.isolate, )); final testCache = File(_dillCachePath); @@ -211,9 +211,13 @@ String testBootstrapContents({ required Uri testUri, required String languageVersionComment, required Uri? packageConfigUri, - required String bootstrapType, -}) => - ''' + required VmTestType testType, +}) { + final (argType, argName, bootstrapType) = switch (testType) { + VmTestType.isolate => ('_, SendPort', 'sendPort', 'Vm'), + VmTestType.process => ('List', 'args', 'Native'), + }; + return ''' $languageVersionComment import 'dart:isolate'; @@ -224,7 +228,10 @@ String testBootstrapContents({ const packageConfigLocation = '$packageConfigUri'; - void main(_, SendPort sendPort) { - internalBootstrap${bootstrapType}Test(() => test.main, sendPort); + void main($argType $argName) { + internalBootstrap${bootstrapType}Test(() => test.main, $argName); } '''; +} + +enum VmTestType { isolate, process } From c7f702b73291320c23007d93912d72a022944fd5 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 26 Jun 2024 22:23:11 +0000 Subject: [PATCH 6/8] Review changes Use `packageConfigUri` - we should already be validating a non-null package config for platforms where this is used. Use a non-null argument. Don't reuse part of the args in the template - repeat the arg name in `mainArgs` and `forwardedArgName`. Add a comment on the variable to remind us that usage will not be obvious. --- pkgs/test_core/lib/src/runner/vm/platform.dart | 4 ++-- .../lib/src/runner/vm/test_compiler.dart | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/test_core/lib/src/runner/vm/platform.dart b/pkgs/test_core/lib/src/runner/vm/platform.dart index 4e3b070f9..506909db7 100644 --- a/pkgs/test_core/lib/src/runner/vm/platform.dart +++ b/pkgs/test_core/lib/src/runner/vm/platform.dart @@ -302,7 +302,7 @@ stderr: ${processResult.stderr}'''); ..writeAsStringSync(testBootstrapContents( testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, - packageConfigUri: await Isolate.packageConfig, + packageConfigUri: await packageConfigUri, testType: VmTestType.isolate, )); } @@ -323,7 +323,7 @@ stderr: ${processResult.stderr}'''); ..writeAsStringSync(testBootstrapContents( testUri: await absoluteUri(testPath), languageVersionComment: languageVersionComment, - packageConfigUri: await Isolate.packageConfig, + packageConfigUri: await packageConfigUri, testType: VmTestType.process, )); } diff --git a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart index a4e3f2d46..56fbbd24f 100644 --- a/pkgs/test_core/lib/src/runner/vm/test_compiler.dart +++ b/pkgs/test_core/lib/src/runner/vm/test_compiler.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:isolate'; import 'package:async/async.dart'; import 'package:frontend_server_client/frontend_server_client.dart'; @@ -96,7 +95,7 @@ class _TestCompilerForLanguageVersion { final tempFile = File(p.join(_outputDillDirectory.path, 'test.dart')) ..writeAsStringSync(testBootstrapContents( testUri: mainUri, - packageConfigUri: await Isolate.packageConfig, + packageConfigUri: await packageConfigUri, languageVersionComment: _languageVersionComment, testType: VmTestType.isolate, )); @@ -210,12 +209,12 @@ String _dillCacheSuffix( String testBootstrapContents({ required Uri testUri, required String languageVersionComment, - required Uri? packageConfigUri, + required Uri packageConfigUri, required VmTestType testType, }) { - final (argType, argName, bootstrapType) = switch (testType) { - VmTestType.isolate => ('_, SendPort', 'sendPort', 'Vm'), - VmTestType.process => ('List', 'args', 'Native'), + final (mainArgs, forwardedArgName, bootstrapType) = switch (testType) { + VmTestType.isolate => ('_, SendPort sendPort', 'sendPort', 'Vm'), + VmTestType.process => ('List args', 'args', 'Native'), }; return ''' $languageVersionComment @@ -226,10 +225,12 @@ String testBootstrapContents({ import '$testUri' as test; + // This variable is read at runtime through the VM service and is unsafe to + // remove. const packageConfigLocation = '$packageConfigUri'; - void main($argType $argName) { - internalBootstrap${bootstrapType}Test(() => test.main, $argName); + void main($mainArgs) { + internalBootstrap${bootstrapType}Test(() => test.main, $forwardedArgName); } '''; } From 27ad950e9658ce7396048d33387cabd05a5d1d07 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 27 Jun 2024 18:44:01 +0000 Subject: [PATCH 7/8] Add a test Add mono_pkg and pubspec configuration to run tests from the `test_core` package. --- pkgs/test_core/mono_pkg.yaml | 4 +++ pkgs/test_core/pubspec.yaml | 1 + pkgs/test_core/pubspec_overrides.yaml | 2 ++ .../test/runner/vm/test_compiler_test.dart | 25 +++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 pkgs/test_core/test/runner/vm/test_compiler_test.dart diff --git a/pkgs/test_core/mono_pkg.yaml b/pkgs/test_core/mono_pkg.yaml index 8f6daee37..9ef792787 100644 --- a/pkgs/test_core/mono_pkg.yaml +++ b/pkgs/test_core/mono_pkg.yaml @@ -11,3 +11,7 @@ stages: - group: - analyze sdk: pubspec +- unit_test: + - group: + - command: dart test + sdk: [dev, pubspec] diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index c1d1c9b0c..71bebd27a 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -32,3 +32,4 @@ dependencies: dev_dependencies: dart_flutter_team_lints: ^3.0.0 + test: any diff --git a/pkgs/test_core/pubspec_overrides.yaml b/pkgs/test_core/pubspec_overrides.yaml index 2a7f631aa..a265a692e 100644 --- a/pkgs/test_core/pubspec_overrides.yaml +++ b/pkgs/test_core/pubspec_overrides.yaml @@ -1,3 +1,5 @@ dependency_overrides: test_api: path: ../test_api + test: + path: ../test diff --git a/pkgs/test_core/test/runner/vm/test_compiler_test.dart b/pkgs/test_core/test/runner/vm/test_compiler_test.dart new file mode 100644 index 000000000..a6e50efe6 --- /dev/null +++ b/pkgs/test_core/test/runner/vm/test_compiler_test.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2024, 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:convert'; + +import 'package:test/test.dart'; +import 'package:test_core/src/runner/vm/test_compiler.dart'; + +void main() { + group('VM test templates', () { + test('include package config URI variable', () async { + // This variable is read through the VM service and should not be removed. + final template = testBootstrapContents( + testUri: Uri.file('foo.dart'), + languageVersionComment: '// version comment', + packageConfigUri: Uri.file('package_config.json'), + testType: VmTestType.isolate, + ); + final lines = LineSplitter.split(template).map((line) => line.trim()); + expect(lines, + contains("const packageConfigLocation = 'package_config.json';")); + }); + }); +} From b506e9c0a87e6591d3dac22e52ea79728f0ff3c3 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 27 Jun 2024 18:52:10 +0000 Subject: [PATCH 8/8] Rerun monorepo --- .github/workflows/dart.yml | 122 +++++++++++++++++++++++++++++-------- 1 file changed, 97 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index b8b1b5fcb..c7d56c6ec 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -308,6 +308,41 @@ jobs: - job_003 - job_004 job_007: + name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test_core; `dart test`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/test_core;commands:command_01" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/test_core + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 + - id: pkgs_test_core_pub_upgrade + name: pkgs/test_core; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/test_core + - name: pkgs/test_core; dart test + run: dart test + if: "always() && steps.pkgs_test_core_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/test_core + needs: + - job_001 + - job_002 + - job_003 + - job_004 + job_008: name: "unit_test; linux; Dart 3.4.0; PKG: integration_tests/spawn_hybrid; `dart test -p chrome,vm,node`" runs-on: ubuntu-latest steps: @@ -342,7 +377,7 @@ jobs: - job_002 - job_003 - job_004 - job_008: + job_009: name: "unit_test; linux; Dart 3.4.0; PKG: integration_tests/wasm; `pushd /tmp && wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb && sudo dpkg -i google-chrome-beta_current_amd64.deb && popd && which google-chrome-beta`, `dart test --timeout=60s`" runs-on: ubuntu-latest steps: @@ -381,7 +416,7 @@ jobs: - job_002 - job_003 - job_004 - job_009: + job_010: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 0`" runs-on: ubuntu-latest steps: @@ -416,7 +451,7 @@ jobs: - job_002 - job_003 - job_004 - job_010: + job_011: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 1`" runs-on: ubuntu-latest steps: @@ -451,7 +486,7 @@ jobs: - job_002 - job_003 - job_004 - job_011: + job_012: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 2`" runs-on: ubuntu-latest steps: @@ -486,7 +521,7 @@ jobs: - job_002 - job_003 - job_004 - job_012: + job_013: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 3`" runs-on: ubuntu-latest steps: @@ -521,7 +556,7 @@ jobs: - job_002 - job_003 - job_004 - job_013: + job_014: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 4`" runs-on: ubuntu-latest steps: @@ -556,7 +591,7 @@ jobs: - job_002 - job_003 - job_004 - job_014: + job_015: name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/test_api; `dart test --preset travis -x browser`" runs-on: ubuntu-latest steps: @@ -591,7 +626,7 @@ jobs: - job_002 - job_003 - job_004 - job_015: + job_016: name: "unit_test; linux; Dart dev; PKG: integration_tests/regression; `dart test`" runs-on: ubuntu-latest steps: @@ -626,7 +661,7 @@ jobs: - job_002 - job_003 - job_004 - job_016: + job_017: name: "unit_test; linux; Dart dev; PKG: pkgs/checks; `dart test`" runs-on: ubuntu-latest steps: @@ -661,7 +696,42 @@ jobs: - job_002 - job_003 - job_004 - job_017: + job_018: + name: "unit_test; linux; Dart dev; PKG: pkgs/test_core; `dart test`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/test_core;commands:command_01" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/test_core + 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: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 + - id: pkgs_test_core_pub_upgrade + name: pkgs/test_core; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/test_core + - name: pkgs/test_core; dart test + run: dart test + if: "always() && steps.pkgs_test_core_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/test_core + needs: + - job_001 + - job_002 + - job_003 + - job_004 + job_019: name: "unit_test; linux; Dart dev; PKG: integration_tests/spawn_hybrid; `dart test -p chrome,vm,node`" runs-on: ubuntu-latest steps: @@ -696,7 +766,7 @@ jobs: - job_002 - job_003 - job_004 - job_018: + job_020: name: "unit_test; linux; Dart dev; PKG: integration_tests/wasm; `pushd /tmp && wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb && sudo dpkg -i google-chrome-beta_current_amd64.deb && popd && which google-chrome-beta`, `dart test --timeout=60s`" runs-on: ubuntu-latest steps: @@ -735,7 +805,7 @@ jobs: - job_002 - job_003 - job_004 - job_019: + job_021: name: "unit_test; linux; Dart dev; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 0`" runs-on: ubuntu-latest steps: @@ -770,7 +840,7 @@ jobs: - job_002 - job_003 - job_004 - job_020: + job_022: name: "unit_test; linux; Dart dev; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 1`" runs-on: ubuntu-latest steps: @@ -805,7 +875,7 @@ jobs: - job_002 - job_003 - job_004 - job_021: + job_023: name: "unit_test; linux; Dart dev; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 2`" runs-on: ubuntu-latest steps: @@ -840,7 +910,7 @@ jobs: - job_002 - job_003 - job_004 - job_022: + job_024: name: "unit_test; linux; Dart dev; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 3`" runs-on: ubuntu-latest steps: @@ -875,7 +945,7 @@ jobs: - job_002 - job_003 - job_004 - job_023: + job_025: name: "unit_test; linux; Dart dev; PKG: pkgs/test; `xvfb-run -s \"-screen 0 1024x768x24\" dart test --preset travis --total-shards 5 --shard-index 4`" runs-on: ubuntu-latest steps: @@ -910,7 +980,7 @@ jobs: - job_002 - job_003 - job_004 - job_024: + job_026: name: "unit_test; linux; Dart dev; PKG: pkgs/test_api; `dart test --preset travis -x browser`" runs-on: ubuntu-latest steps: @@ -945,7 +1015,7 @@ jobs: - job_002 - job_003 - job_004 - job_025: + job_027: name: "unit_test; windows; Dart 3.4.0; PKG: integration_tests/spawn_hybrid; `dart test -p chrome,vm,node`" runs-on: windows-latest steps: @@ -970,7 +1040,7 @@ jobs: - job_002 - job_003 - job_004 - job_026: + job_028: name: "unit_test; windows; Dart 3.4.0; PKG: pkgs/test; `dart test --preset travis --total-shards 5 --shard-index 0`" runs-on: windows-latest steps: @@ -995,7 +1065,7 @@ jobs: - job_002 - job_003 - job_004 - job_027: + job_029: name: "unit_test; windows; Dart 3.4.0; PKG: pkgs/test; `dart test --preset travis --total-shards 5 --shard-index 1`" runs-on: windows-latest steps: @@ -1020,7 +1090,7 @@ jobs: - job_002 - job_003 - job_004 - job_028: + job_030: name: "unit_test; windows; Dart 3.4.0; PKG: pkgs/test; `dart test --preset travis --total-shards 5 --shard-index 2`" runs-on: windows-latest steps: @@ -1045,7 +1115,7 @@ jobs: - job_002 - job_003 - job_004 - job_029: + job_031: name: "unit_test; windows; Dart 3.4.0; PKG: pkgs/test; `dart test --preset travis --total-shards 5 --shard-index 3`" runs-on: windows-latest steps: @@ -1070,7 +1140,7 @@ jobs: - job_002 - job_003 - job_004 - job_030: + job_032: name: "unit_test; windows; Dart 3.4.0; PKG: pkgs/test; `dart test --preset travis --total-shards 5 --shard-index 4`" runs-on: windows-latest steps: @@ -1095,7 +1165,7 @@ jobs: - job_002 - job_003 - job_004 - job_031: + job_033: name: "unit_test; windows; Dart dev; PKG: integration_tests/spawn_hybrid; `dart test -p chrome,vm,node`" runs-on: windows-latest steps: @@ -1120,7 +1190,7 @@ jobs: - job_002 - job_003 - job_004 - job_032: + job_034: name: Notify failure runs-on: ubuntu-latest if: "(github.event_name == 'push' || github.event_name == 'schedule') && failure()" @@ -1163,3 +1233,5 @@ jobs: - job_029 - job_030 - job_031 + - job_032 + - job_033