diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 55e48f9d4..506c6be54 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.5.4 +# Created with package:mono_repo v6.5.5 name: Dart CI on: push: @@ -36,7 +36,7 @@ jobs: name: Checkout repository uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - name: mono_repo self validate - run: dart pub global activate mono_repo 6.5.4 + run: dart pub global activate mono_repo 6.5.5 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: @@ -1033,14 +1033,14 @@ jobs: - job_005 - job_006 job_027: - name: "unit_test; linux; Dart main; 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`" + name: "unit_test; linux; Dart main; 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: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:integration_tests/wasm;commands:command_00-command_01" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:integration_tests/wasm;commands:command_00-test_1" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:integration_tests/wasm os:ubuntu-latest;pub-cache-hosted;sdk:main @@ -1062,8 +1062,8 @@ jobs: run: "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" if: "always() && steps.integration_tests_wasm_pub_upgrade.conclusion == 'success'" working-directory: integration_tests/wasm - - name: integration_tests/wasm; dart test - run: dart test + - name: "integration_tests/wasm; dart test --timeout=60s" + run: "dart test --timeout=60s" if: "always() && steps.integration_tests_wasm_pub_upgrade.conclusion == 'success'" working-directory: integration_tests/wasm needs: diff --git a/integration_tests/wasm/mono_pkg.yaml b/integration_tests/wasm/mono_pkg.yaml index b360a9986..b09a8da9d 100644 --- a/integration_tests/wasm/mono_pkg.yaml +++ b/integration_tests/wasm/mono_pkg.yaml @@ -18,6 +18,7 @@ stages: - which google-chrome-beta os: - linux - - test: + # The config here is a regression test for https://github.com/dart-lang/test/issues/2006 + - test: --timeout=60s os: - linux diff --git a/integration_tests/wasm/test/hello_world_test.dart b/integration_tests/wasm/test/hello_world_test.dart index 5d911a79f..40d4a74f3 100644 --- a/integration_tests/wasm/test/hello_world_test.dart +++ b/integration_tests/wasm/test/hello_world_test.dart @@ -1,7 +1,10 @@ // Copyright (c) 2022, 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. + @TestOn('wasm') +// This retry is a regression test for https://github.com/dart-lang/test/issues/2006 +@Retry(2) import 'package:test/test.dart'; void main() { diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 828fb16fd..8c0254eca 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,5 +1,7 @@ ## 1.24.3-wip +* Fix compatibility with wasm number semantics. + ## 1.24.2 * Copy an existing nonce from a script on the test HTML page to the script diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 58cb29648..8667d3698 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -32,8 +32,8 @@ dependencies: webkit_inspection_protocol: ^1.0.0 yaml: ^3.0.0 # Use an exact version until the test_api and test_core package are stable. - test_api: 0.5.2 - test_core: 0.5.2 + test_api: 0.5.3 + test_core: 0.5.3 # Use a tight version constraint to ensure that a constraint on matcher # properly constrains all features it provides. matcher: '>=0.12.15 <0.12.16' diff --git a/pkgs/test/tool/host.dart b/pkgs/test/tool/host.dart index 23d83aec6..5ba8b06ba 100644 --- a/pkgs/test/tool/host.dart +++ b/pkgs/test/tool/host.dart @@ -130,9 +130,9 @@ void main() { serverChannel.stream.listen((message) { if (message['command'] == 'loadSuite') { var suiteChannel = - serverChannel.virtualChannel(message['channel'] as int); - var iframeChannel = - _connectToIframe(message['url'] as String, message['id'] as int); + serverChannel.virtualChannel((message['channel'] as num).toInt()); + var iframeChannel = _connectToIframe( + message['url'] as String, (message['id'] as num).toInt()); suiteChannel.pipe(iframeChannel); } else if (message['command'] == 'displayPause') { dom.document.body!.classList.add('paused'); diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index ec38d0ca0..4d79f0a59 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.3-wip + +* Fix compatibility with wasm number semantics. + ## 0.5.2 * Remove deprecation for the `scaffolding.dart` and `backend.dart` libraries. diff --git a/pkgs/test_api/lib/src/backend/metadata.dart b/pkgs/test_api/lib/src/backend/metadata.dart index 0404dbfbc..59ffa5c78 100644 --- a/pkgs/test_api/lib/src/backend/metadata.dart +++ b/pkgs/test_api/lib/src/backend/metadata.dart @@ -264,7 +264,7 @@ class Metadata { skipReason = serialized['skipReason'] as String?, _verboseTrace = serialized['verboseTrace'] as bool?, _chainStackTraces = serialized['chainStackTraces'] as bool?, - _retry = serialized['retry'] as int?, + _retry = (serialized['retry'] as num?)?.toInt(), tags = Set.from(serialized['tags'] as Iterable), onPlatform = { for (var pair in serialized['onPlatform'] as List) @@ -282,7 +282,8 @@ class Metadata { if (serialized == 'none') return Timeout.none; var scaleFactor = serialized['scaleFactor']; if (scaleFactor != null) return Timeout.factor(scaleFactor as num); - return Timeout(Duration(microseconds: serialized['duration'] as int)); + return Timeout( + Duration(microseconds: (serialized['duration'] as num).toInt())); } /// Throws an [ArgumentError] if any tags in [tags] aren't hyphenated diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index 91e0126ab..651b4b9c5 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -1,5 +1,5 @@ name: test_api -version: 0.5.2 +version: 0.5.3-wip description: >- The user facing API for structuring Dart tests and checking expectations. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 6542bf473..2f6be0845 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,5 +1,7 @@ ## 0.5.3-wip +* Fix compatibility with wasm number semantics. + ## 0.5.2 * Use the version `0.5.2` of `packge:test_api`. diff --git a/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart b/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart index 660c4374b..58e9f2483 100644 --- a/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart +++ b/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart @@ -155,7 +155,7 @@ class _Deserializer { var metadata = Metadata.deserialize(test['metadata']); var trace = test['trace'] == null ? null : Trace.parse(test['trace'] as String); - var testChannel = _channel.virtualChannel(test['channel'] as int); + var testChannel = _channel.virtualChannel((test['channel'] as num).toInt()); return RunnerTest(test['name'] as String, metadata, trace, testChannel); } } diff --git a/pkgs/test_core/lib/src/runner/runner_test.dart b/pkgs/test_core/lib/src/runner/runner_test.dart index 68658da9f..35bdecfc0 100644 --- a/pkgs/test_core/lib/src/runner/runner_test.dart +++ b/pkgs/test_core/lib/src/runner/runner_test.dart @@ -70,7 +70,8 @@ class RunnerTest extends Test { // this virtual channel and cause the spawned isolate to close as // well. spawnHybridUri(message['url'] as String, message['message'], suite) - .pipe(testChannel.virtualChannel(message['channel'] as int)); + .pipe(testChannel + .virtualChannel((message['channel'] as num).toInt())); break; } }, onDone: () { diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 6cf8cb15e..a19ded379 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -30,7 +30,7 @@ dependencies: # matcher is tightly constrained by test_api matcher: ^0.12.11 # Use an exact version until the test_api package is stable. - test_api: 0.5.2 + test_api: 0.5.3 dev_dependencies: lints: '>=1.0.0 <3.0.0' diff --git a/tool/ci.sh b/tool/ci.sh index 11c9fa32a..b6efae0f9 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Created with package:mono_repo v6.5.4 +# Created with package:mono_repo v6.5.5 # Support built in commands on windows out of the box. # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") @@ -135,6 +135,10 @@ for PKG in ${PKGS}; do echo 'dart test -p chrome,vm,node' dart test -p chrome,vm,node || EXIT_CODE=$? ;; + test_1) + echo 'dart test --timeout=60s' + dart test --timeout=60s || EXIT_CODE=$? + ;; *) echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m" exit 64