Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIP-1903 Run unit tests in dart2js on CI #28

Merged
merged 2 commits into from
Jan 6, 2017
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
1 change: 1 addition & 0 deletions smithy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ runner_image: drydock-prod.workiva.org/workiva/smithy-runner-dart:74173

script:
- pub get
- ./tool/smithy_dart2js_tests.sh

artifacts:
build:
Expand Down
2 changes: 1 addition & 1 deletion test/over_react/component/dom_components_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library dom_components_test;
// Tell dart2js that this library only needs to reflect the specified types.
// This speeds up compilation and makes JS output much smaller.
@MirrorsUsed(targets: const [
'over_react.Dom'
'over_react.dom_components.Dom'
])
import 'dart:mirrors';

Expand Down
6 changes: 5 additions & 1 deletion tool/dev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ main(List<String> args) async {
..pubServe = true
..platforms = [
'vm',
'content-shell'
'content-shell',
// Can't run tests in dart2js on Travis since the suite takes too long to load and times out.
// Run on Smithy instead.
// See https://github.com/Workiva/over_react/issues/36
// 'chrome',
]
// Prevent test load timeouts on Smithy.
..concurrency = 1
Expand Down
18 changes: 18 additions & 0 deletions tool/smithy_dart2js_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Can't run tests in dart2js on Travis since the suite takes too long to load and times out.
# Run on Smithy instead.
# See https://github.com/Workiva/over_react/issues/36

set -e

# Trick the test package into using Chromium instead of Chrome
TMP_BIN=$(mktemp -d)
ln -s "$(which chromium-browser)" "$TMP_BIN/google-chrome"
export PATH="$PATH:$TMP_BIN"

# Run the tests
DART_FLAGS=--checked xvfb-run -s '-screen 0 1024x768x24' pub run dart_dev test -p chrome

# Be sneaky and clean up our tricks
rm -rf "$TMP_BIN"