Skip to content

Commit ab602a8

Browse files
committed
chore(travis): fail build if a test has been 'iit'ed
Change the build script to fail when a test was 'itt'ed or 'ddescribe'ed. Closes dart-archive#922
1 parent 1c7c0ba commit ab602a8

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ packages:
3636
guinness:
3737
description: guinness
3838
source: hosted
39-
version: "0.1.5"
39+
version: "0.1.9"
4040
html5lib:
4141
description: html5lib
4242
source: hosted

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ dev_dependencies:
2929
benchmark_harness: '>=1.0.0'
3030
unittest: '>=0.10.1 <0.12.0'
3131
mock: '>=0.10.0 <0.12.0'
32-
guinness: '>=0.1.3 <0.2.0'
32+
guinness: '>=0.1.9 <0.2.0'

scripts/travis/build.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ echo BROWSER=$BROWSERS
9898
$NGDART_BASE_DIR/node_modules/jasmine-node/bin/jasmine-node playback_middleware/spec/ &&
9999
node "node_modules/karma/bin/karma" start karma.conf \
100100
--reporters=junit,dots --port=8765 --runner-port=8766 \
101-
--browsers=$BROWSERS --single-run --no-colors
101+
--browsers=$BROWSERS --single-run --no-colors 2>&1 | tee karma-output.log
102+
103+
if grep -q "WARN: iit" karma-output.log; then
104+
echo "ERROR: iit caused some tests to be excluded"
105+
exit 1
106+
fi
107+
108+
if grep -q "WARN: ddescribe" karma-output.log; then
109+
echo "ERROR: ddescribe caused some tests to be excluded"
110+
exit 1
111+
fi
112+
102113

103114
echo '-------------------------'
104115
echo '-- DOCS: Generate Docs --'

test/config/init_guinness.dart

+15
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,20 @@ import 'package:unittest/unittest.dart' as unit;
44
main() {
55
unit.filterStacks = true;
66
unit.formatStacks = false;
7+
8+
_printWarnings();
9+
10+
guinness.autoInit = false;
711
guinness.initSpecs();
812
}
13+
14+
_printWarnings () {
15+
final info = guinness.suiteInfo();
16+
17+
if (info.activeIts.any((it) => it.exclusive))
18+
print("WARN: iit caused some tests to be excluded");
19+
20+
if (info.exclusiveDescribes.isNotEmpty)
21+
print("WARN: ddescribe caused some tests to be excluded");
22+
}
23+

0 commit comments

Comments
 (0)