From ae2f09c084e645922645899cdf49c1c480b60995 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 28 Dec 2016 15:12:09 -0700 Subject: [PATCH 1/2] Fix @MirrorsUsed target in test --- test/over_react/component/dom_components_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/over_react/component/dom_components_test.dart b/test/over_react/component/dom_components_test.dart index 2061cb09e..03793f301 100644 --- a/test/over_react/component/dom_components_test.dart +++ b/test/over_react/component/dom_components_test.dart @@ -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'; From ab356ca41d1ec0f57fb7120701b74099da74c555 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 30 Dec 2016 02:05:32 -0700 Subject: [PATCH 2/2] Run tests in dart2js on Chromium on Smithy --- smithy.yaml | 1 + tool/dev.dart | 6 +++++- tool/smithy_dart2js_tests.sh | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 tool/smithy_dart2js_tests.sh diff --git a/smithy.yaml b/smithy.yaml index 3b5f060bf..ac9b6981e 100644 --- a/smithy.yaml +++ b/smithy.yaml @@ -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: diff --git a/tool/dev.dart b/tool/dev.dart index e3f9d88f0..83740a084 100644 --- a/tool/dev.dart +++ b/tool/dev.dart @@ -30,7 +30,11 @@ main(List 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 diff --git a/tool/smithy_dart2js_tests.sh b/tool/smithy_dart2js_tests.sh new file mode 100755 index 000000000..3b613e109 --- /dev/null +++ b/tool/smithy_dart2js_tests.sh @@ -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"