Skip to content

Commit

Permalink
Run web tests with wasm with dev Dart sdk (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Dec 14, 2023
1 parent b3adc7c commit 10cbffe
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 22 deletions.
62 changes: 53 additions & 9 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.1
name: Dart CI
on:
push:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.5.7
run: dart pub global activate mono_repo 6.6.1
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
Expand Down Expand Up @@ -461,6 +461,50 @@ jobs:
- job_003
- job_004
job_007:
name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/shelf-pkgs/shelf_test_handler;commands:test_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/shelf-pkgs/shelf_test_handler
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@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- id: pkgs_shelf_pub_upgrade
name: pkgs/shelf; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf
- name: "pkgs/shelf; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm"
run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm"
if: "always() && steps.pkgs_shelf_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf
- id: pkgs_shelf_test_handler_pub_upgrade
name: pkgs/shelf_test_handler; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf_test_handler
- name: "pkgs/shelf_test_handler; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm"
run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm"
if: "always() && steps.pkgs_shelf_test_handler_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_test_handler
needs:
- job_001
- job_002
- job_003
- job_004
job_008:
name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -504,7 +548,7 @@ jobs:
- job_002
- job_003
- job_004
job_008:
job_009:
name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -602,15 +646,15 @@ jobs:
- job_002
- job_003
- job_004
job_009:
job_010:
name: "unit_test; linux; Dart dev; PKG: pkgs/shelf_router_generator; `dart test --run-skipped -t presubmit-only`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/shelf_router_generator;commands:test_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/shelf_router_generator;commands:test_3"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/shelf_router_generator
os:ubuntu-latest;pub-cache-hosted;sdk:dev
Expand All @@ -637,7 +681,7 @@ jobs:
- job_002
- job_003
- job_004
job_010:
job_011:
name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -671,7 +715,7 @@ jobs:
- job_002
- job_003
- job_004
job_011:
job_012:
name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -723,7 +767,7 @@ jobs:
- job_002
- job_003
- job_004
job_012:
job_013:
name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -757,7 +801,7 @@ jobs:
- job_002
- job_003
- job_004
job_013:
job_014:
name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/shelf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.4.2-dev
## 1.4.2-wip

* Require Dart ^3.0.0

Expand Down
2 changes: 2 additions & 0 deletions pkgs/shelf/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ stages:
os:
- linux
- windows
- test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm
sdk: dev
2 changes: 1 addition & 1 deletion pkgs/shelf/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shelf
version: 1.4.2-dev
version: 1.4.2-wip
description: >
A model for web server middleware that encourages composition and easy reuse.
repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf
Expand Down
2 changes: 2 additions & 0 deletions pkgs/shelf_test_handler/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ stages:
os:
- linux
- windows
- test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm
sdk: dev
22 changes: 11 additions & 11 deletions tool/ci.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.1

# Support built in commands on windows out of the box.

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter pub" is called instead of "dart pub".
# This assumes that the Flutter SDK has been installed in a previous step.
function pub() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand All @@ -12,18 +13,13 @@ function pub() {
command dart pub "$@"
fi
}
# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# This assumes that the Flutter SDK has been installed in a previous step.

function format() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
command flutter format "$@"
else
command dart format "$@"
fi
command dart format "$@"
}

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter analyze" is called instead of "dart analyze".
# This assumes that the Flutter SDK has been installed in a previous step.
function analyze() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand Down Expand Up @@ -84,6 +80,10 @@ for PKG in ${PKGS}; do
dart test --test-randomize-ordering-seed=random -p chrome || EXIT_CODE=$?
;;
test_2)
echo 'dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm'
dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm || EXIT_CODE=$?
;;
test_3)
echo 'dart test --run-skipped -t presubmit-only'
dart test --run-skipped -t presubmit-only || EXIT_CODE=$?
;;
Expand Down

0 comments on commit 10cbffe

Please sign in to comment.