Skip to content

Commit c168b03

Browse files
authored
Fix node bootstrapping for dart2 (#811)
1 parent f4e99de commit c168b03

File tree

9 files changed

+24
-51
lines changed

9 files changed

+24
-51
lines changed

.travis.yml

+9-40
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ sudo: required
55
dist: trusty
66

77
dart:
8-
- stable
8+
- dev
99

10-
env: FORCE_TEST_EXIT=true DARTIUM_EXPIRATION_TIME=1550044800LL
10+
env: FORCE_TEST_EXIT=true
1111

1212
# Content shell needs these fonts.
1313
addons:
@@ -38,45 +38,14 @@ before_install:
3838
- ln -s `pwd`/`echo drt-linux-*`/content_shell bin/content_shell
3939

4040
dart_task:
41-
# Browser tests take particularly long on Dartium, so we split them up into different tasks.
42-
- test: --platform dartium
43-
install_dartium: true
44-
41+
- dartfmt
42+
- dartanalyzer
4543
# Split the tests into five shards to help parallelize them across Travis workers.
46-
- test: --preset travis --total-shards 5 --shard-index 0
47-
install_dartium: true
48-
- test: --preset travis --total-shards 5 --shard-index 1
49-
install_dartium: true
50-
- test: --preset travis --total-shards 5 --shard-index 2
51-
install_dartium: true
52-
- test: --preset travis --total-shards 5 --shard-index 3
53-
install_dartium: true
54-
- test: --preset travis --total-shards 5 --shard-index 4
55-
install_dartium: true
56-
57-
matrix:
58-
include:
59-
# Browser tests take particularly long, so we split them up into different tasks.
60-
- dart: dev
61-
dart_task: {test: --platform chrome}
62-
63-
# Split the tests into five shards to help parallelize them across Travis workers.
64-
# Don't run Dartium tests on dev because 2.0.0 doesn't support Dartium anymore.
65-
- dart: dev
66-
dart_task: {test: --preset travis --total-shards 5 --shard-index 0 -x dartium}
67-
- dart: dev
68-
dart_task: {test: --preset travis --total-shards 5 --shard-index 1 -x dartium}
69-
- dart: dev
70-
dart_task: {test: --preset travis --total-shards 5 --shard-index 2 -x dartium}
71-
- dart: dev
72-
dart_task: {test: --preset travis --total-shards 5 --shard-index 3 -x dartium}
73-
- dart: dev
74-
dart_task: {test: --preset travis --total-shards 5 --shard-index 4 -x dartium}
75-
76-
- dart: dev
77-
dart_task: dartfmt
78-
- dart: dev
79-
dart_task: dartanalyzer
44+
- test: --preset travis --total-shards 5 --shard-index 0 -x dartium
45+
- test: --preset travis --total-shards 5 --shard-index 1 -x dartium
46+
- test: --preset travis --total-shards 5 --shard-index 2 -x dartium
47+
- test: --preset travis --total-shards 5 --shard-index 3 -x dartium
48+
- test: --preset travis --total-shards 5 --shard-index 4 -x dartium
8049

8150
# Only building master means that we don't run two builds for each pull request.
8251
branches:

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
## 0.12.34+1
1+
## 0.12.35
22

3+
* Dropped support for Dart 1. Going forward only Dart 2 will be supported.
4+
* If you experience blocking issues and are still on the Dart 1 sdk, we will
5+
consider bug fixes on a per-case basis based on severity and impact.
36
* Fixed an issue `--precompiled` node tests in subdirectories.
7+
* Fixed some dart2 issues with node test bootstrapping code so that dartdevc
8+
tests can run.
49
* Fixed default custom html handler so it correctly includes the
510
packages/test/dart.js file. This allows you to get proper errors instead of
611
timeouts if there are load exceptions in the browser.

dart_test.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ tags:
3030
firefox: {add_tags: [dart2js]}
3131
chrome: {add_tags: [dart2js]}
3232
phantomjs: {add_tags: [dart2js]}
33-
dartium: {add_tags: [browser]}
3433

3534
safari:
3635
add_tags: [dart2js]

lib/src/bootstrap/node.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "../util/stack_trace_mapper.dart";
1313
void internalBootstrapNodeTest(Function getMain()) {
1414
var channel = serializeSuite(getMain, beforeLoad: () async {
1515
var serialized = await suiteChannel("test.node.mapper").stream.first;
16-
if (serialized == null) return;
16+
if (serialized == null || serialized is! Map) return;
1717
setStackTraceMapper(StackTraceMapper.deserialize(serialized));
1818
});
1919
socketChannel().pipe(channel);

lib/src/runner/node/socket_channel.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class _Socket {
3030

3131
/// Returns a [StreamChannel] of JSON-encodable objects that communicates over a
3232
/// socket whose port is given by `process.argv[2]`.
33-
StreamChannel socketChannel() {
33+
StreamChannel<Object> socketChannel() {
3434
var controller = new StreamChannelController<String>(
3535
allowForeignErrors: false, sync: true);
3636
var net = _require("net");

lib/src/runner/remote_listener.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class RemoteListener {
4949
// This has to be synchronous to work around sdk#25745. Otherwise, there'll
5050
// be an asynchronous pause before a syntax error notification is sent,
5151
// which will cause the send to fail entirely.
52-
var controller =
53-
new StreamChannelController(allowForeignErrors: false, sync: true);
52+
var controller = new StreamChannelController<Object>(
53+
allowForeignErrors: false, sync: true);
5454
var channel = new MultiChannel(controller.local);
5555

5656
var verboseChain = true;

lib/src/util/stack_trace_mapper.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class StackTraceMapper {
6060
sdkRoot: Uri.parse(serialized['sdkRoot']),
6161
packageResolver: packageRoot.isNotEmpty
6262
? new SyncPackageResolver.root(Uri.parse(serialized['packageRoot']))
63-
: new SyncPackageResolver.config(
64-
_deserializePackageConfigMap(serialized['packageConfigMap'])),
63+
: new SyncPackageResolver.config(_deserializePackageConfigMap(
64+
serialized['packageConfigMap'].cast<String, String>())),
6565
mapUrl: Uri.parse(serialized['mapUrl']));
6666
}
6767

lib/src/utils.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final lineSplitter = new StreamTransformer<List<int>, String>(
3737
///
3838
/// Note that this is only safe for channels whose messages are guaranteed not
3939
/// to contain newlines.
40-
final chunksToLines = new StreamChannelTransformer(
40+
final chunksToLines = new StreamChannelTransformer<String, String>(
4141
const LineSplitter(),
4242
new StreamSinkTransformer.fromHandlers(
4343
handleData: (data, sink) => sink.add("$data\n")));

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: test
2-
version: 0.12.34+1
2+
version: 0.12.35
33
author: Dart Team <[email protected]>
44
description: A library for writing dart unit tests.
55
homepage: https://github.com/dart-lang/test
66
environment:
7-
sdk: '>=1.24.0 <2.0.0'
7+
sdk: '>=2.0.0-dev.22.0 <2.0.0'
88
dependencies:
99
analyzer: '>=0.26.4 <0.32.0'
1010
args: '>=0.13.1 <2.0.0'

0 commit comments

Comments
 (0)