Skip to content

Commit

Permalink
Run tests for package:rfw on stable as well.
Browse files Browse the repository at this point in the history
For non-master-channel builds, the run_tests.sh script runs but
doesn't bother checking the actual coverage, since I expect Dart's
coverage logic to diverge in master and so we'd have to have
per-channel covered line counts, and that way lies madness.

No version change: Only affects how tests are run, not a public-facing change.
No CHANGELOG change: Only affects how tests are run, not a public-facing change.
  • Loading branch information
Hixie committed Feb 17, 2022
1 parent a7b028e commit 8c69ffc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 34 deletions.
25 changes: 3 additions & 22 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,8 @@ task:
script:
# extension_google_sign_in_as_googleapis_auth is currently not building, see
# https://github.com/flutter/flutter/issues/89301
# rfw is excluded until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the ios tests below.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
- ./script/tool_runner.sh native-test --android --no-integration
- else
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth,rfw
- ./script/tool_runner.sh native-test --android --no-integration --exclude=rfw
- fi
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
- ./script/tool_runner.sh native-test --android --no-integration
depends_on:
- format+analyze
- name: web_benchmarks_test
Expand Down Expand Up @@ -127,16 +117,7 @@ task:
CHANNEL: "stable"
<< : *FLUTTER_UPGRADE_TEMPLATE
build_script:
# Exclude rfw until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the android tests above.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --ios
- else
- ./script/tool_runner.sh build-examples --ios --exclude=rfw
- fi
- ./script/tool_runner.sh build-examples --ios

task:
name: local_tests
Expand Down
19 changes: 7 additions & 12 deletions packages/rfw/test_coverage/bin/test_coverage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ const String lastUpdate = '2021-08-30';
Future<void> main(List<String> arguments) async {
// This script is mentioned in the README.md file.

if (Platform.environment['CHANNEL'] == 'stable') {
// For now these are disabled because this package has never been supported
// on the stable channel and requires newer language features that have not
// yet shipped to a stable build. It will be possible to test this with the
// first stable to ship after October 2021.
print(
'Skipping tests on stable channel.\n'
'These tests can be unskipped once we ship a stable after October 2021.',
);
exit(0);
}

final Directory coverageDirectory = Directory('coverage');

if (coverageDirectory.existsSync()) {
Expand All @@ -45,9 +33,16 @@ Future<void> main(List<String> arguments) async {
print(result.stdout);
print(result.stderr);
print('Tests failed.');
// leave coverage directory around to aid debugging
exit(1);
}

if (Platform.environment['CHANNEL'] != 'master') {
print('Tests passed. (Coverage verification skipped; not on master channel.)');
coverageDirectory.deleteSync(recursive: true);
exit(0);
}

final List<lcov.Record> records = await lcov.Parser.parse(
'coverage/lcov.info',
);
Expand Down

0 comments on commit 8c69ffc

Please sign in to comment.