Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

chore(travis): fail build if a test has been 'iit'ed #1172

Closed
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
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ packages:
guinness:
description: guinness
source: hosted
version: "0.1.5"
version: "0.1.9"
html5lib:
description: html5lib
source: hosted
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ dev_dependencies:
benchmark_harness: '>=1.0.0'
unittest: '>=0.10.1 <0.12.0'
mock: '>=0.10.0 <0.12.0'
guinness: '>=0.1.3 <0.2.0'
guinness: '>=0.1.9 <0.2.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update package dependencies in a different PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. It is required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is required, that we need to land the guinness upgrade first and then land this PR. We still need two PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there is already a PR to upgrade guinness created by @vicb (#1078). After it gets merged, I'll update this PR.

13 changes: 12 additions & 1 deletion scripts/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,18 @@ echo BROWSER=$BROWSERS
$NGDART_BASE_DIR/node_modules/jasmine-node/bin/jasmine-node playback_middleware/spec/ &&
node "node_modules/karma/bin/karma" start karma.conf \
--reporters=junit,dots --port=8765 --runner-port=8766 \
--browsers=$BROWSERS --single-run --no-colors
--browsers=$BROWSERS --single-run --no-colors 2>&1 | tee karma-output.log

if grep -q "WARN: iit" karma-output.log; then
echo "ERROR: iit caused some tests to be excluded"
exit 1
fi

if grep -q "WARN: ddescribe" karma-output.log; then
echo "ERROR: ddescribe caused some tests to be excluded"
exit 1
fi


echo '-------------------------'
echo '-- DOCS: Generate Docs --'
Expand Down
17 changes: 17 additions & 0 deletions test/config/init_guinness.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,22 @@ import 'package:unittest/unittest.dart' as unit;
main() {
unit.filterStacks = true;
unit.formatStacks = false;

_printWarnings();

guinness.autoInit = false;
guinness.initSpecs();
}

_printWarnings () {
final info = guinness.suiteInfo();

if (info.activeIts.any((it) => it.exclusive)) {
print("WARN: iit caused some tests to be excluded");
}

if (info.exclusiveDescribes.isNotEmpty) {
print("WARN: ddescribe caused some tests to be excluded");
}
}