Unverified Commit 698d458d authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Add chrome stable to dockerfile and web shard (#33787)

parent c91b6571
......@@ -76,6 +76,9 @@ task:
container:
cpu: 4
memory: 12G
- name: web_tests-linux
env:
SHARD: web_tests
- name: build_tests-linux
env:
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 List<String> flutterTestArgs = <String>[];
final bool useFlutterTestFormatter = Platform.environment['FLUTTER_TEST_FORMATTER'] == 'true';
final bool noUseBuildRunner = Platform.environment['FLUTTER_TEST_NO_BUILD_RUNNER'] == 'true';
const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
'tests': _runTests,
'web_tests': _runWebTests,
'tool_tests': _runToolTests,
'build_tests': _runBuildTests,
'coverage': _runCoverage,
......@@ -340,6 +340,19 @@ Future<void> _runTests() async {
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 {
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
if (!coverageFile.existsSync()) {
......@@ -592,6 +605,32 @@ class EvalResult {
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, {
String script,
bool expectFailure = false,
......
......@@ -26,6 +26,10 @@ RUN apt-get install -y --no-install-recommends \
ca-certificates \
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.
ENV NODEJS_INSTALL="/opt/nodejs_install"
RUN mkdir -p "${NODEJS_INSTALL}"
......@@ -43,7 +47,8 @@ RUN apt-get install -y --no-install-recommends \
libstdc++6 \
libglu1-mesa \
build-essential \
default-jdk-headless
default-jdk-headless \
google-chrome-stable
# Install the Android SDK Dependency.
ENV ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
......
......@@ -7,7 +7,7 @@ Google internal environment.
After setup,
* edit `Dockerfile` to change how the container image is built.
* run `./build_docker.sh` to build the container image.
* run `./push_docker.sh` to push the image to google cloud registry. This will
* run `./docker_build.sh` to build the container image.
* run `./docker_push.sh` to push the image to google cloud registry. This will
affect our CI tests.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment