Skip to content

add windows travis config, remove appveyor config #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Created with package:mono_repo v2.2.0
# Created with package:mono_repo v2.3.0
language: dart

# Custom configuration
sudo: required
addons:
chrome: stable
before_install:
- "export CHROMEDRIVER_BINARY=/usr/bin/google-chrome"
- "export CHROMEDRIVER_ARGS=--no-sandbox"
- "/usr/bin/google-chrome --version"
- "export CHROME_LATEST_VERSION=$(/usr/bin/google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1)"
- "export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_LATEST_VERSION)"
- "wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip"
- unzip chromedriver_linux64.zip
- tool/travis_setup.sh
- "export PATH=$PATH:$PWD"
after_failure:
- tool/report_failure.sh
Expand All @@ -24,31 +18,49 @@ jobs:
- stage: analyzer_and_format
name: "SDK: 2.5.0; PKGS: dwds, example, webdev; TASKS: `dartanalyzer --fatal-warnings .`"
dart: "2.5.0"
os: linux
env: PKGS="dwds example webdev"
script: ./tool/travis.sh dartanalyzer_1
- stage: analyzer_and_format
name: "SDK: dev; PKGS: dwds, example, webdev; TASKS: [`dartfmt -n --set-exit-if-changed .`, `dartanalyzer --fatal-infos --fatal-warnings .`]"
dart: dev
os: linux
env: PKGS="dwds example webdev"
script: ./tool/travis.sh dartfmt dartanalyzer_0
- stage: unit_test
name: "SDK: 2.5.0; PKG: dwds; TASKS: `pub run test`"
dart: "2.5.0"
os: linux
env: PKGS="dwds"
script: ./tool/travis.sh test_0
- stage: unit_test
name: "SDK: stable; PKG: dwds; TASKS: `pub run test`"
dart: stable
os: linux
env: PKGS="dwds"
script: ./tool/travis.sh test_0
- stage: unit_test
name: "SDK: stable; PKG: dwds; TASKS: `pub run test`"
dart: stable
os: windows
env: PKGS="dwds"
script: ./tool/travis.sh test_0
- stage: unit_test
name: "SDK: 2.5.0; PKG: webdev; TASKS: `pub run test -j 1`"
dart: "2.5.0"
os: linux
env: PKGS="webdev"
script: ./tool/travis.sh test_1
- stage: unit_test
name: "SDK: stable; PKG: webdev; TASKS: `pub run test -j 1`"
dart: stable
os: linux
env: PKGS="webdev"
script: ./tool/travis.sh test_1
- stage: unit_test
name: "SDK: stable; PKG: webdev; TASKS: `pub run test -j 1`"
dart: stable
os: windows
env: PKGS="webdev"
script: ./tool/travis.sh test_1

Expand Down
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

Binary file added dwds/chromedriver.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions dwds/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ stages:
dart: [2.5.0]
- unit_test:
- test:
- test:
os: windows
dart: stable
10 changes: 10 additions & 0 deletions dwds/test/chrome_proxy_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ void main() {
await service.removeBreakpoint(isolate.id, bp.id);
expect(isolate.breakpoints, isEmpty);
});
}, onPlatform: {
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
});

group('callServiceExtension', () {
Expand Down Expand Up @@ -374,6 +376,8 @@ void main() {
expect(scriptRef.uri, endsWith('.dart'));
expect(script.tokenPosTable, isNotEmpty);
}
}, onPlatform: {
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
});
});

Expand All @@ -391,6 +395,8 @@ void main() {
scripts.scripts.map((s) => s.uri), contains(endsWith('part.dart')));
expect(scripts.scripts.map((s) => s.uri),
contains('package:intl/src/intl/date_format_helpers.dart'));
}, onPlatform: {
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
});

test('clearVMTimeline', () {
Expand Down Expand Up @@ -466,6 +472,8 @@ void main() {
expect(first.code.kind, 'Dart');
expect(first.code.name, '<closure>');
});
}, onPlatform: {
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
});

group('getStack', () {
Expand Down Expand Up @@ -537,6 +545,8 @@ void main() {
// Resume the isolate to not impact other tests.
await service.resume(isolateId);
});
}, onPlatform: {
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
});

test('getVM', () async {
Expand Down
4 changes: 4 additions & 0 deletions dwds/test/dart_uri_file_uri_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'dart:io';

import 'package:path/path.dart' as p;
Expand Down
4 changes: 4 additions & 0 deletions dwds/test/dart_uri_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'package:dwds/src/utilities/dart_uri.dart';
import 'package:test/test.dart';

Expand Down
3 changes: 3 additions & 0 deletions dwds/test/debug_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// When run locally this test may require a manifest key. This makes it easy to
// just skip it.
@Tags(['extension'])
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'package:test/test.dart';

import 'fixtures/context.dart';
Expand Down
4 changes: 4 additions & 0 deletions dwds/test/debug_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'dart:io';

import 'package:test/test.dart';
Expand Down
4 changes: 4 additions & 0 deletions dwds/test/devtools_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(minutes: 5))
@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'package:test/test.dart';
import 'package:webdriver/io.dart';

Expand Down
32 changes: 24 additions & 8 deletions dwds/test/fixtures/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:build_daemon/client.dart';
Expand All @@ -20,6 +21,9 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
import 'server.dart';
import 'utilities.dart';

final _batExt = Platform.isWindows ? '.bat' : '';
final _exeExt = Platform.isWindows ? '.exe' : '';

class TestContext {
String appUrl;
WipConnection tabConnection;
Expand Down Expand Up @@ -70,16 +74,24 @@ class TestContext {
enableDebugExtension ??= false;
autoRun ??= true;
enableDebugging ??= true;
port = await findUnusedPort();
var chromeDriverPort = await findUnusedPort();
var chromeDriverUrlBase = 'wd/hub';
try {
chromeDriver = await Process.start(
'chromedriver', ['--port=4444', '--url-base=wd/hub']);
chromeDriver = await Process.start('chromedriver$_exeExt',
['--port=$chromeDriverPort', '--url-base=$chromeDriverUrlBase']);
// On windows this takes a while to boot up, wait for the first line
// of stdout as a signal that it is ready.
await chromeDriver.stdout
.transform(utf8.decoder)
.transform(const LineSplitter())
.first;
} catch (e) {
throw StateError(
'Could not start ChromeDriver. Is it installed?\nError: $e');
}

await Process.run('pub', ['get'], workingDirectory: workingDirectory);
await Process.run('pub$_batExt', ['upgrade'],
workingDirectory: workingDirectory);

daemonClient = await connectClient(
workingDirectory, [], (log) => printOnFailure(log.toString()));
Expand Down Expand Up @@ -109,10 +121,14 @@ class TestContext {
]
}
});
webDriver =
await createDriver(spec: WebDriverSpec.JsonWire, desired: capabilities);
webDriver = await createDriver(
spec: WebDriverSpec.JsonWire,
desired: capabilities,
uri: Uri.parse(
'http://127.0.0.1:$chromeDriverPort/$chromeDriverUrlBase/'));
var connection = ChromeConnection('localhost', debugPort);

port = await findUnusedPort();
testServer = await TestServer.start(
port,
daemonPort(workingDirectory),
Expand Down Expand Up @@ -146,12 +162,12 @@ class TestContext {
}

Future<Null> tearDown() async {
await webDriver?.quit();
chromeDriver?.kill();
DartUri.currentDirectory = p.current;
_entryFile.writeAsStringSync(_entryContents);
await daemonClient?.close();
await testServer?.stop();
await webDriver?.quit();
chromeDriver.kill();
}

Future<void> changeInput() async {
Expand Down
5 changes: 4 additions & 1 deletion dwds/test/refresh_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

/// Tests that require a fresh context to run, and can interfere with other
/// tests.
@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
library refresh_test;

@TestOn('vm')
import 'dart:async';

import 'package:dwds/src/connections/debug_connection.dart';
Expand Down
4 changes: 4 additions & 0 deletions dwds/test/reload_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('vm')
@Timeout(Duration(minutes: 5))
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})

import 'package:dwds/dwds.dart';
import 'package:test/test.dart';
Expand Down
5 changes: 4 additions & 1 deletion dwds/test/variable_scope_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:dwds/src/connections/debug_connection.dart';
@TestOn('vm')
@OnPlatform({
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
})
import 'package:dwds/src/connections/debug_connection.dart';
import 'package:dwds/src/services/chrome_proxy_service.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
Expand Down
10 changes: 2 additions & 8 deletions mono_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ travis:
addons:
chrome: stable
before_install:
- "export CHROMEDRIVER_BINARY=/usr/bin/google-chrome"
- "export CHROMEDRIVER_ARGS=--no-sandbox"
- "/usr/bin/google-chrome --version"
- "export CHROME_LATEST_VERSION=$(/usr/bin/google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1)"
- "export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_LATEST_VERSION)"
- "wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip"
- "unzip chromedriver_linux64.zip"
- "export PATH=$PATH:$PWD"
- tool/travis_setup.sh
- export PATH=$PATH:$PWD
after_failure:
- tool/report_failure.sh
services:
Expand Down
25 changes: 24 additions & 1 deletion tool/travis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
#!/bin/bash
# Created with package:mono_repo v2.2.0
# Created with package:mono_repo v2.3.0

# Support built in commands on windows out of the box.
function pub {
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
command pub.bat "$@"
else
command pub "$@"
fi
}
function dartfmt {
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
command dartfmt.bat "$@"
else
command dartfmt "$@"
fi
}
function dartanalyzer {
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
command dartanalyzer.bat "$@"
else
command dartanalyzer "$@"
fi
}

if [[ -z ${PKGS} ]]; then
echo -e '\033[31mPKGS environment variable must be set!\033[0m'
Expand Down
Loading