mirror of
https://github.com/flutter/packages.git
synced 2025-07-02 08:34:31 +08:00
[rfw] Run tests for package:rfw on stable as well. (#888)
This commit is contained in:
37
.cirrus.yml
37
.cirrus.yml
@ -103,16 +103,8 @@ task:
|
||||
CHANNEL: "master"
|
||||
CHANNEL: "stable"
|
||||
script:
|
||||
# Exclude:
|
||||
# - flutter_image; its tests need a test server, so are run via
|
||||
# local_tests.sh.
|
||||
# - rfw on stable; it includes golden tests whose results differ
|
||||
# between branch
|
||||
- if [[ "$CHANNEL" == "master" ]]; then
|
||||
- ./script/tool_runner.sh test --exclude=flutter_image
|
||||
- else
|
||||
- ./script/tool_runner.sh test --exclude=flutter_image,rfw
|
||||
- fi
|
||||
# We exclude flutter_image because its tests need a test server, so are run via local_tests.sh.
|
||||
- ./script/tool_runner.sh test --exclude=flutter_image
|
||||
depends_on:
|
||||
- format+analyze
|
||||
- name: android-build+platform-tests
|
||||
@ -123,18 +115,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
|
||||
@ -164,16 +146,7 @@ task:
|
||||
CHANNEL: "master"
|
||||
CHANNEL: "stable"
|
||||
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
|
||||
- name: local_tests
|
||||
env:
|
||||
PATH: $PATH:/usr/local/bin
|
||||
|
@ -266,3 +266,7 @@ When contributing code, ensure that `flutter test --coverage; lcov
|
||||
update `test_coverage/bin/test_coverage.dart` with the appropriate
|
||||
expectations to prevent future coverage regressions. (That program is
|
||||
run by `run_tests.sh`.)
|
||||
|
||||
Golden tests are only run against the Flutter master channel and only
|
||||
run on Linux, since minor rendering differences are expected on
|
||||
different platforms and on different versions of Flutter.
|
@ -4,11 +4,18 @@
|
||||
|
||||
// This file is hand-formatted.
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:rfw/formats.dart' show parseLibraryFile;
|
||||
import 'package:rfw/rfw.dart';
|
||||
|
||||
// See Contributing section of README.md file.
|
||||
final bool runGoldens = Platform.isLinux &&
|
||||
(!Platform.environment.containsKey('CHANNEL') ||
|
||||
Platform.environment['CHANNEL'] == 'master');
|
||||
|
||||
void main() {
|
||||
testWidgets('String example', (WidgetTester tester) async {
|
||||
Duration? duration;
|
||||
@ -494,5 +501,5 @@ void main() {
|
||||
find.byType(RemoteWidget),
|
||||
matchesGoldenFile('goldens/argument_decoders_test.gridview.custom.png'),
|
||||
);
|
||||
});
|
||||
}, skip: !runGoldens);
|
||||
}
|
||||
|
@ -2,11 +2,18 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:rfw/formats.dart' show parseLibraryFile;
|
||||
import 'package:rfw/rfw.dart';
|
||||
|
||||
// See Contributing section of README.md file.
|
||||
final bool runGoldens = Platform.isLinux &&
|
||||
(!Platform.environment.containsKey('CHANNEL') ||
|
||||
Platform.environment['CHANNEL'] == 'master');
|
||||
|
||||
void main() {
|
||||
testWidgets('Material widgets', (WidgetTester tester) async {
|
||||
final Runtime runtime = Runtime()
|
||||
@ -140,5 +147,5 @@ void main() {
|
||||
find.byType(RemoteWidget),
|
||||
matchesGoldenFile('goldens/material_test.drawer.png'),
|
||||
);
|
||||
});
|
||||
}, skip: !runGoldens);
|
||||
}
|
||||
|
@ -15,39 +15,32 @@ 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()) {
|
||||
coverageDirectory.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
// We run with --update-goldens because the goal here is not to verify the tests
|
||||
// pass but to verify the coverage, and the goldens are not always going to pass
|
||||
// when run on different platforms (e.g. on Cirrus we run this on a mac but the
|
||||
// goldens expect a linux box).
|
||||
final ProcessResult result = Process.runSync(
|
||||
'flutter',
|
||||
<String>['test', '--coverage', '--update-goldens'],
|
||||
<String>['test', '--coverage'],
|
||||
);
|
||||
if (result.exitCode != 0) {
|
||||
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',
|
||||
);
|
||||
|
Reference in New Issue
Block a user