Fix a Metadata bug. (#504)
Closes #503
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a404ef5..3a67eb0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.12.17+1
+
+* Fix a bug where tags couldn't be marked as skipped.
+
## 0.12.17
* Deprecate `expectAsync` and `expectAsyncUntil`, since they currently can't be
diff --git a/lib/src/backend/metadata.dart b/lib/src/backend/metadata.dart
index 013d91f..bdbf470 100644
--- a/lib/src/backend/metadata.dart
+++ b/lib/src/backend/metadata.dart
@@ -262,8 +262,8 @@
new Metadata(
testOn: testOn.intersection(other.testOn),
timeout: timeout.merge(other.timeout),
- skip: other._skip ?? _skip ,
- skipReason: other.skipReason == null ? skipReason : other.skipReason,
+ skip: other._skip ?? _skip,
+ skipReason: other.skipReason ?? skipReason,
verboseTrace: other._verboseTrace ?? _verboseTrace,
tags: tags.union(other.tags),
onPlatform: mergeMaps(onPlatform, other.onPlatform,
@@ -319,9 +319,9 @@
return {
'testOn': testOn == PlatformSelector.all ? null : testOn.toString(),
'timeout': _serializeTimeout(timeout),
- 'skip': skip,
+ 'skip': _skip,
'skipReason': skipReason,
- 'verboseTrace': verboseTrace,
+ 'verboseTrace': _verboseTrace,
'tags': tags.toList(),
'onPlatform': serializedOnPlatform,
'forTag': mapMap(forTag,
diff --git a/pubspec.yaml b/pubspec.yaml
index 0020fa0..8ce4edd 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: test
-version: 0.12.17
+version: 0.12.17+1
author: Dart Team <misc@dartlang.org>
description: A library for writing dart unit tests.
homepage: https://github.com/dart-lang/test
diff --git a/test/runner/configuration/tags_test.dart b/test/runner/configuration/tags_test.dart
index 3968edd..a4ff34c 100644
--- a/test/runner/configuration/tags_test.dart
+++ b/test/runner/configuration/tags_test.dart
@@ -132,6 +132,30 @@
test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
test.shouldExit(0);
});
+
+ // Regression test for #503.
+ test("skips tests whose tags are marked as skip", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "tags": {"foo": {"skip": "some reason"}}
+ })).create();
+
+ d.file("test.dart", """
+ import 'dart:async';
+
+ import 'package:test/test.dart';
+
+ void main() {
+ test("test 1", () => throw 'bad', tags: ['foo']);
+ }
+ """).create();
+
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(containsInOrder([
+ "some reason",
+ "All tests skipped."
+ ]));
+ test.shouldExit(0);
+ });
});
group("include_tags and exclude_tags", () {