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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [2.0.4](https://github.com/Workiva/dart_dev/compare/2.0.3...2.0.4)

- **Bug Fix:** When on Dart 2 and the package has a dependency on `build_test`,
the `test` task will now properly exit with a non-zero exit code if the build
fails.

## [2.0.3](https://github.com/Workiva/dart_dev/compare/2.0.2...2.0.3)

- **Feature:** Use `--disable-serve-std-out` or set
`config.test.disableServeStdOut = true` with the `test` task to silence the
pub serve output.

## [2.0.2](https://github.com/Workiva/dart_dev/compare/2.0.1...2.0.2)

- **Improvement:** The test task now fails early if running on Dart 2 with
either the `dartium` or `content-shell` platforms are selected.

- **Bug Fix:** Prevent a null exception in the reporter when running on Dart
>=2.1.0.

## [2.0.1](https://github.com/Workiva/dart_dev/compare/2.0.0...2.0.1)

_December 11, 2018_
Expand Down
14 changes: 13 additions & 1 deletion lib/src/tasks/test/cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import 'dart:async';

import 'package:args/args.dart';

import 'package:dart_dev/util.dart' show reporter, isPortBound;
import 'package:dart_dev/util.dart'
show hasImmediateDependency, isPortBound, reporter, TaskProcess;

import 'package:dart_dev/src/platform_util/api.dart' as platform_util;
import 'package:dart_dev/src/tasks/cli.dart';
Expand Down Expand Up @@ -183,6 +184,17 @@ class TestCli extends TaskCli {
testArgs.add('--pause-after-load');
}

if (dartMajorVersion == 2 && hasImmediateDependency('build_test')) {
final buildProcess =
new TaskProcess('pub', ['run', 'build_runner', 'build']);
reporter.logGroup('pub run build_runner build',
outputStream: buildProcess.stdout, errorStream: buildProcess.stderr);
final buildExitCode = await buildProcess.exitCode;
if (buildExitCode != 0) {
return new CliResult.fail('Build failed - cannot run tests.');
}
}

PubServeTask pubServeTask;

if (pubServe) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/dart_x_only_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void main() {
});

test('runs an executable', () async {
final result = await runDart2Only(['dartdoc']);
final result = await runDart2Only(['pub']);
expect(result.skipped, isFalse);
expect(result.exitCode, 0);
});
Expand Down