Add chrome stable to dockerfile and web shard (#33787)
This commit is contained in:
parent
c91b657116
commit
698d458dc8
@ -76,6 +76,9 @@ task:
|
|||||||
container:
|
container:
|
||||||
cpu: 4
|
cpu: 4
|
||||||
memory: 12G
|
memory: 12G
|
||||||
|
- name: web_tests-linux
|
||||||
|
env:
|
||||||
|
SHARD: web_tests
|
||||||
- name: build_tests-linux
|
- name: build_tests-linux
|
||||||
env:
|
env:
|
||||||
SHARD: build_tests
|
SHARD: build_tests
|
||||||
|
@ -22,13 +22,13 @@ final String pub = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Pla
|
|||||||
final String pubCache = path.join(flutterRoot, '.pub-cache');
|
final String pubCache = path.join(flutterRoot, '.pub-cache');
|
||||||
final List<String> flutterTestArgs = <String>[];
|
final List<String> flutterTestArgs = <String>[];
|
||||||
|
|
||||||
|
|
||||||
final bool useFlutterTestFormatter = Platform.environment['FLUTTER_TEST_FORMATTER'] == 'true';
|
final bool useFlutterTestFormatter = Platform.environment['FLUTTER_TEST_FORMATTER'] == 'true';
|
||||||
|
|
||||||
final bool noUseBuildRunner = Platform.environment['FLUTTER_TEST_NO_BUILD_RUNNER'] == 'true';
|
final bool noUseBuildRunner = Platform.environment['FLUTTER_TEST_NO_BUILD_RUNNER'] == 'true';
|
||||||
|
|
||||||
const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
|
const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
|
||||||
'tests': _runTests,
|
'tests': _runTests,
|
||||||
|
'web_tests': _runWebTests,
|
||||||
'tool_tests': _runToolTests,
|
'tool_tests': _runToolTests,
|
||||||
'build_tests': _runBuildTests,
|
'build_tests': _runBuildTests,
|
||||||
'coverage': _runCoverage,
|
'coverage': _runCoverage,
|
||||||
@ -340,6 +340,19 @@ Future<void> _runTests() async {
|
|||||||
print('${bold}DONE: All tests successful.$reset');
|
print('${bold}DONE: All tests successful.$reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _runWebTests() async {
|
||||||
|
final List<String> testfiles = <String>[];
|
||||||
|
final Directory foundation = Directory(path.join(flutterRoot, 'packages', 'flutter', 'test', 'foundation'));
|
||||||
|
for (FileSystemEntity entity in foundation.listSync(recursive: true)) {
|
||||||
|
if (entity is File) {
|
||||||
|
testfiles.add(entity.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await _runFlutterWebTest(path.join(flutterRoot, 'packages', 'flutter'), expectFailure: true, tests: <String>[
|
||||||
|
path.join('test', 'foundation'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _runCoverage() async {
|
Future<void> _runCoverage() async {
|
||||||
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
|
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
|
||||||
if (!coverageFile.existsSync()) {
|
if (!coverageFile.existsSync()) {
|
||||||
@ -592,6 +605,32 @@ class EvalResult {
|
|||||||
final int exitCode;
|
final int exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _runFlutterWebTest(String workingDirectory, {
|
||||||
|
bool expectFailure = false,
|
||||||
|
bool printOutput = true,
|
||||||
|
bool skip = false,
|
||||||
|
Duration timeout = _kLongTimeout,
|
||||||
|
List<String> tests,
|
||||||
|
}) async {
|
||||||
|
final List<String> args = <String>['test', '--platform=chrome'];
|
||||||
|
if (flutterTestArgs != null && flutterTestArgs.isNotEmpty)
|
||||||
|
args.addAll(flutterTestArgs);
|
||||||
|
|
||||||
|
args.add('--machine');
|
||||||
|
args.addAll(tests);
|
||||||
|
|
||||||
|
await runCommand(
|
||||||
|
flutter,
|
||||||
|
args,
|
||||||
|
workingDirectory: workingDirectory,
|
||||||
|
expectNonZeroExit: expectFailure,
|
||||||
|
timeout: timeout,
|
||||||
|
environment: <String, String>{
|
||||||
|
'FLUTTER_WEB': 'true',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _runFlutterTest(String workingDirectory, {
|
Future<void> _runFlutterTest(String workingDirectory, {
|
||||||
String script,
|
String script,
|
||||||
bool expectFailure = false,
|
bool expectFailure = false,
|
||||||
|
@ -26,6 +26,10 @@ RUN apt-get install -y --no-install-recommends \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
gnupg
|
gnupg
|
||||||
|
|
||||||
|
# Add repo for chrome stable
|
||||||
|
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||||
|
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list
|
||||||
|
|
||||||
# Add nodejs repository to apt sources and install it.
|
# Add nodejs repository to apt sources and install it.
|
||||||
ENV NODEJS_INSTALL="/opt/nodejs_install"
|
ENV NODEJS_INSTALL="/opt/nodejs_install"
|
||||||
RUN mkdir -p "${NODEJS_INSTALL}"
|
RUN mkdir -p "${NODEJS_INSTALL}"
|
||||||
@ -43,7 +47,8 @@ RUN apt-get install -y --no-install-recommends \
|
|||||||
libstdc++6 \
|
libstdc++6 \
|
||||||
libglu1-mesa \
|
libglu1-mesa \
|
||||||
build-essential \
|
build-essential \
|
||||||
default-jdk-headless
|
default-jdk-headless \
|
||||||
|
google-chrome-stable
|
||||||
|
|
||||||
# Install the Android SDK Dependency.
|
# Install the Android SDK Dependency.
|
||||||
ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
|
ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
|
||||||
|
@ -7,7 +7,7 @@ Google internal environment.
|
|||||||
|
|
||||||
After setup,
|
After setup,
|
||||||
* edit `Dockerfile` to change how the container image is built.
|
* edit `Dockerfile` to change how the container image is built.
|
||||||
* run `./build_docker.sh` to build the container image.
|
* run `./docker_build.sh` to build the container image.
|
||||||
* run `./push_docker.sh` to push the image to google cloud registry. This will
|
* run `./docker_push.sh` to push the image to google cloud registry. This will
|
||||||
affect our CI tests.
|
affect our CI tests.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user