Skip to content

Commit dd93344

Browse files
authored
add windows travis config, remove appveyor config (#712)
1 parent 65fd8e1 commit dd93344

20 files changed

+168
-48
lines changed

.travis.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
# Created with package:mono_repo v2.2.0
1+
# Created with package:mono_repo v2.3.0
22
language: dart
33

44
# Custom configuration
55
sudo: required
66
addons:
77
chrome: stable
88
before_install:
9-
- "export CHROMEDRIVER_BINARY=/usr/bin/google-chrome"
10-
- "export CHROMEDRIVER_ARGS=--no-sandbox"
11-
- "/usr/bin/google-chrome --version"
12-
- "export CHROME_LATEST_VERSION=$(/usr/bin/google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1)"
13-
- "export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_LATEST_VERSION)"
14-
- "wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip"
15-
- unzip chromedriver_linux64.zip
9+
- tool/travis_setup.sh
1610
- "export PATH=$PATH:$PWD"
1711
after_failure:
1812
- tool/report_failure.sh
@@ -24,31 +18,49 @@ jobs:
2418
- stage: analyzer_and_format
2519
name: "SDK: 2.5.0; PKGS: dwds, example, webdev; TASKS: `dartanalyzer --fatal-warnings .`"
2620
dart: "2.5.0"
21+
os: linux
2722
env: PKGS="dwds example webdev"
2823
script: ./tool/travis.sh dartanalyzer_1
2924
- stage: analyzer_and_format
3025
name: "SDK: dev; PKGS: dwds, example, webdev; TASKS: [`dartfmt -n --set-exit-if-changed .`, `dartanalyzer --fatal-infos --fatal-warnings .`]"
3126
dart: dev
27+
os: linux
3228
env: PKGS="dwds example webdev"
3329
script: ./tool/travis.sh dartfmt dartanalyzer_0
3430
- stage: unit_test
3531
name: "SDK: 2.5.0; PKG: dwds; TASKS: `pub run test`"
3632
dart: "2.5.0"
33+
os: linux
3734
env: PKGS="dwds"
3835
script: ./tool/travis.sh test_0
3936
- stage: unit_test
4037
name: "SDK: stable; PKG: dwds; TASKS: `pub run test`"
4138
dart: stable
39+
os: linux
40+
env: PKGS="dwds"
41+
script: ./tool/travis.sh test_0
42+
- stage: unit_test
43+
name: "SDK: stable; PKG: dwds; TASKS: `pub run test`"
44+
dart: stable
45+
os: windows
4246
env: PKGS="dwds"
4347
script: ./tool/travis.sh test_0
4448
- stage: unit_test
4549
name: "SDK: 2.5.0; PKG: webdev; TASKS: `pub run test -j 1`"
4650
dart: "2.5.0"
51+
os: linux
52+
env: PKGS="webdev"
53+
script: ./tool/travis.sh test_1
54+
- stage: unit_test
55+
name: "SDK: stable; PKG: webdev; TASKS: `pub run test -j 1`"
56+
dart: stable
57+
os: linux
4758
env: PKGS="webdev"
4859
script: ./tool/travis.sh test_1
4960
- stage: unit_test
5061
name: "SDK: stable; PKG: webdev; TASKS: `pub run test -j 1`"
5162
dart: stable
63+
os: windows
5264
env: PKGS="webdev"
5365
script: ./tool/travis.sh test_1
5466

appveyor.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

dwds/chromedriver.exe

8.3 MB
Binary file not shown.

dwds/mono_pkg.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ stages:
1414
dart: [2.5.0]
1515
- unit_test:
1616
- test:
17+
- test:
18+
os: windows
19+
dart: stable

dwds/test/chrome_proxy_service_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ void main() {
107107
await service.removeBreakpoint(isolate.id, bp.id);
108108
expect(isolate.breakpoints, isEmpty);
109109
});
110+
}, onPlatform: {
111+
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
110112
});
111113

112114
group('callServiceExtension', () {
@@ -374,6 +376,8 @@ void main() {
374376
expect(scriptRef.uri, endsWith('.dart'));
375377
expect(script.tokenPosTable, isNotEmpty);
376378
}
379+
}, onPlatform: {
380+
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
377381
});
378382
});
379383

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

396402
test('clearVMTimeline', () {
@@ -466,6 +472,8 @@ void main() {
466472
expect(first.code.kind, 'Dart');
467473
expect(first.code.name, '<closure>');
468474
});
475+
}, onPlatform: {
476+
'windows': const Skip('https://github.com/dart-lang/webdev/issues/711'),
469477
});
470478

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

542552
test('getVM', () async {

dwds/test/dart_uri_file_uri_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
@TestOn('vm')
6+
@OnPlatform({
7+
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
8+
})
59
import 'dart:io';
610

711
import 'package:path/path.dart' as p;

dwds/test/dart_uri_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

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

dwds/test/debug_extension_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// When run locally this test may require a manifest key. This makes it easy to
66
// just skip it.
77
@Tags(['extension'])
8+
@OnPlatform({
9+
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
10+
})
811
import 'package:test/test.dart';
912

1013
import 'fixtures/context.dart';

dwds/test/debug_service_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
@TestOn('vm')
6+
@OnPlatform({
7+
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
8+
})
59
import 'dart:io';
610

711
import 'package:test/test.dart';

dwds/test/devtools_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// BSD-style license that can be found in the LICENSE file.
44

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

dwds/test/fixtures/context.dart

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:convert';
67
import 'dart:io';
78

89
import 'package:build_daemon/client.dart';
@@ -20,6 +21,9 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
2021
import 'server.dart';
2122
import 'utilities.dart';
2223

24+
final _batExt = Platform.isWindows ? '.bat' : '';
25+
final _exeExt = Platform.isWindows ? '.exe' : '';
26+
2327
class TestContext {
2428
String appUrl;
2529
WipConnection tabConnection;
@@ -70,16 +74,24 @@ class TestContext {
7074
enableDebugExtension ??= false;
7175
autoRun ??= true;
7276
enableDebugging ??= true;
73-
port = await findUnusedPort();
77+
var chromeDriverPort = await findUnusedPort();
78+
var chromeDriverUrlBase = 'wd/hub';
7479
try {
75-
chromeDriver = await Process.start(
76-
'chromedriver', ['--port=4444', '--url-base=wd/hub']);
80+
chromeDriver = await Process.start('chromedriver$_exeExt',
81+
['--port=$chromeDriverPort', '--url-base=$chromeDriverUrlBase']);
82+
// On windows this takes a while to boot up, wait for the first line
83+
// of stdout as a signal that it is ready.
84+
await chromeDriver.stdout
85+
.transform(utf8.decoder)
86+
.transform(const LineSplitter())
87+
.first;
7788
} catch (e) {
7889
throw StateError(
7990
'Could not start ChromeDriver. Is it installed?\nError: $e');
8091
}
8192

82-
await Process.run('pub', ['get'], workingDirectory: workingDirectory);
93+
await Process.run('pub$_batExt', ['upgrade'],
94+
workingDirectory: workingDirectory);
8395

8496
daemonClient = await connectClient(
8597
workingDirectory, [], (log) => printOnFailure(log.toString()));
@@ -109,10 +121,14 @@ class TestContext {
109121
]
110122
}
111123
});
112-
webDriver =
113-
await createDriver(spec: WebDriverSpec.JsonWire, desired: capabilities);
124+
webDriver = await createDriver(
125+
spec: WebDriverSpec.JsonWire,
126+
desired: capabilities,
127+
uri: Uri.parse(
128+
'http://127.0.0.1:$chromeDriverPort/$chromeDriverUrlBase/'));
114129
var connection = ChromeConnection('localhost', debugPort);
115130

131+
port = await findUnusedPort();
116132
testServer = await TestServer.start(
117133
port,
118134
daemonPort(workingDirectory),
@@ -146,12 +162,12 @@ class TestContext {
146162
}
147163

148164
Future<Null> tearDown() async {
165+
await webDriver?.quit();
166+
chromeDriver?.kill();
149167
DartUri.currentDirectory = p.current;
150168
_entryFile.writeAsStringSync(_entryContents);
151169
await daemonClient?.close();
152170
await testServer?.stop();
153-
await webDriver?.quit();
154-
chromeDriver.kill();
155171
}
156172

157173
Future<void> changeInput() async {

dwds/test/refresh_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

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

9-
@TestOn('vm')
1013
import 'dart:async';
1114

1215
import 'package:dwds/src/connections/debug_connection.dart';

dwds/test/reload_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

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

711
import 'package:dwds/dwds.dart';
812
import 'package:test/test.dart';

dwds/test/variable_scope_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:dwds/src/connections/debug_connection.dart';
65
@TestOn('vm')
6+
@OnPlatform({
7+
'windows': Skip('https://github.com/dart-lang/webdev/issues/711'),
8+
})
9+
import 'package:dwds/src/connections/debug_connection.dart';
710
import 'package:dwds/src/services/chrome_proxy_service.dart';
811
import 'package:test/test.dart';
912
import 'package:vm_service/vm_service.dart';

mono_repo.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ travis:
44
addons:
55
chrome: stable
66
before_install:
7-
- "export CHROMEDRIVER_BINARY=/usr/bin/google-chrome"
8-
- "export CHROMEDRIVER_ARGS=--no-sandbox"
9-
- "/usr/bin/google-chrome --version"
10-
- "export CHROME_LATEST_VERSION=$(/usr/bin/google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1)"
11-
- "export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_LATEST_VERSION)"
12-
- "wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip"
13-
- "unzip chromedriver_linux64.zip"
14-
- "export PATH=$PATH:$PWD"
7+
- tool/travis_setup.sh
8+
- export PATH=$PATH:$PWD
159
after_failure:
1610
- tool/report_failure.sh
1711
services:

tool/travis.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
#!/bin/bash
2-
# Created with package:mono_repo v2.2.0
2+
# Created with package:mono_repo v2.3.0
3+
4+
# Support built in commands on windows out of the box.
5+
function pub {
6+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
7+
command pub.bat "$@"
8+
else
9+
command pub "$@"
10+
fi
11+
}
12+
function dartfmt {
13+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
14+
command dartfmt.bat "$@"
15+
else
16+
command dartfmt "$@"
17+
fi
18+
}
19+
function dartanalyzer {
20+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
21+
command dartanalyzer.bat "$@"
22+
else
23+
command dartanalyzer "$@"
24+
fi
25+
}
326

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

0 commit comments

Comments
 (0)