Skip to content

Commit

Permalink
Exclude non-null-safe builder test cases in Dart 3
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Oct 10, 2024
1 parent ff88b62 commit d754ed8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/dart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ jobs:
- name: Run tests (VM)
# Can't use build_runner (which dart_dev uses if you depend on it) to run VM tests, since we get the error:
# Unable to spawn isolate: /…/build_runner_testRU6M77/.packages: Error: Problem in packages configuration file: Unexpected character
run: dart test -P vm
run: |
DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}"
TEST_ARGS=""
if [[ "$DART_VERSION" =~ ^3 ]]; then
TEST_ARGS="--exclude-tags=dart-2-only"
fi
dart test -P vm "TEST_ARGS"
if: always() && steps.install.outcome == 'success' && steps.build.outcome == 'success'

- name: Run tests (DDC)
Expand Down Expand Up @@ -146,7 +152,13 @@ jobs:
run: dart run build_runner build --build-filter='**.dart' --delete-conflicting-outputs

- name: Run builder tests
run: dart test -p vm -- test/vm_tests/builder
run: |
DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}"
TEST_ARGS=""
if [[ "$DART_VERSION" =~ ^3 ]]; then
TEST_ARGS="--exclude-tags=dart-2-only"
fi
dart test -p vm -- test/vm_tests/builder
analyzer_plugin:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions dart_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ tags:
# Tests that represent a case of undesirable JS interop behavior that's
# either unavoidable or exists as a tradeoff for improved behavior in other cases.
js-interop-tradeoff: {}
# Tests for behavior that's only valid in Dart 2, and does not apply to Dart 3.
dart-2-only: {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'package:test/test.dart';

main() {
group('conditionally null safe builder', () {
group('on package-level Dart version that is not null safe', () {
group('on package-level Dart language version that is not null safe', () {
setUpAll(() {
const nonNullSafePackagePath =
'test_fixtures/test_packages/non_null_safe';
Expand Down Expand Up @@ -81,9 +81,9 @@ main() {
'Using nullSafety: false. {languageVersion: 2.11, source: libraryVersionComment}'));
});
});
});
}, tags: 'dart-2-only');

group('on package-level Dart version that is null safe', () {
group('on package-level Dart language version that is null safe', () {
setUpAll(() {
const nonNullSafePackagePath = 'test_fixtures/test_packages/null_safe';
Process.runSync('dart', ['pub', 'get'],
Expand Down

0 comments on commit d754ed8

Please sign in to comment.