Skip to content
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
5 changes: 3 additions & 2 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
when tests are run directly on platforms which support `dart:io`. The
environment variable takes precedence over configuration in `dart_test.yaml`
but is overridden by the `--reporter` flag when passed to the test runner.
* Include passing test and suite loading messages within the `Passing tests`
group in `GithubReporter`.
* Suppress dart2js compiler output for successful compiles.
* Include output from passing tests messages within the `Passing tests` group
in `GithubReporter`.

## 1.31.2

Expand Down
3 changes: 1 addition & 2 deletions pkgs/test/test/runner/browser/loader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ void main() {
var loadSuite = suites.first;

var liveTest = (loadSuite.group.entries.single as Test).load(loadSuite);
// Skip the "Compiled" message from dart2js.
expect(
liveTest.onMessage.skip(1).first.then((message) => message.text),
liveTest.onMessage.first.then((message) => message.text),
completion(equals('print within test')),
);
await liveTest.run();
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/browser/runner_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {
containsInOrder([
'Error: Compilation failed.',
'-1: loading test.dart [E]',
'Failed to load "test.dart": dart2js failed.',
'Failed to load "test.dart": Bad state: dart2js failed.',
]),
);
await test.shouldExit(1);
Expand Down
16 changes: 0 additions & 16 deletions pkgs/test/test/runner/json_reporter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,6 @@ void main() {
[
suiteJson(0, platform: 'chrome'),
testStartJson(1, 'loading test.dart', groupIDs: []),
printJson(
1,
isA<String>().having(
(s) => s.split('\n'),
'lines',
contains(startsWith('Compiled')),
),
),
testDoneJson(1, hidden: true),
],
[
Expand Down Expand Up @@ -847,14 +839,6 @@ void customTest(String name, dynamic Function() testFn) => test(name, testFn);
[
suiteJson(0, platform: 'chrome'),
testStartJson(1, 'loading test.dart', groupIDs: []),
printJson(
1,
isA<String>().having(
(s) => s.split('\n'),
'lines',
contains(startsWith('Compiled')),
),
),
testDoneJson(1, hidden: true),
],
[
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/node/runner_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void main() {
containsInOrder([
'Error: Compilation failed.',
'-1: loading test.dart [E]',
'Failed to load "test.dart": dart2js failed.',
'Failed to load "test.dart": Bad state: dart2js failed.',
]),
);
await test.shouldExit(1);
Expand Down
5 changes: 3 additions & 2 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## 0.6.20-wip

* Add support for `DART_TEST_REPORTER` environment variable.
* Include passing test and suite loading messages within the `Passing tests`
group in `GithubReporter`.
* Suppress dart2js compiler output for successful compiles.
* Include passing test messages within the `Passing tests` group in
`GithubReporter`.

## 0.6.19

Expand Down
14 changes: 5 additions & 9 deletions pkgs/test_core/lib/src/runner/dart2js_compiler_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import '../util/package_config.dart';
import 'compiler_pool.dart';
import 'suite.dart';

/// A regular expression matching the first status line printed by dart2js.
final _dart2jsStatus = RegExp(
r'^Dart file \(.*\) compiled to JavaScript: .*\n?',
);

/// A pool of `dart2js` instances.
///
/// This limits the number of compiler instances running concurrently.
Expand Down Expand Up @@ -88,10 +83,11 @@ class Dart2JsCompilerPool extends CompilerPool {
_processes.remove(process);
if (closed) return;

var output = buffer.toString().replaceFirst(_dart2jsStatus, '');
if (output.isNotEmpty) print(output);

if (exitCode != 0) throw 'dart2js failed.';
if (exitCode != 0) {
var output = buffer.toString();
if (output.isNotEmpty) print(output);
throw StateError('dart2js failed.');
}

_fixSourceMap('$path.map');
});
Expand Down
9 changes: 5 additions & 4 deletions pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ class WasmCompilerPool extends CompilerPool {
_processes.remove(process);
if (closed) return;

var output = buffer.toString();
if (output.isNotEmpty) print(output);

if (exitCode != 0) throw StateError('dart2wasm failed.');
if (exitCode != 0) {
var output = buffer.toString();
if (output.isNotEmpty) print(output);
throw StateError('dart2wasm failed.');
}
});
}

Expand Down
Loading