build(bazel): fix broken travis CI (#24788)

PR Close #24788
This commit is contained in:
Greg Magolan 2018-07-13 06:35:23 -07:00 committed by Victor Berchet
parent e38b2b502c
commit 8450e0ab2f
3 changed files with 17 additions and 2 deletions

View File

@ -28,8 +28,14 @@
<script>
// TODO(mlaval): remove once we have a proper solution
ngDevMode = false;
var isBazel = location.pathname.indexOf('/all/') !== 0;
// isBazel needed while 'scripts/ci/test-e2e.sh test.e2e.protractor-e2e' is run
// on Travis
// TODO: port remaining protractor e2e tests to bazel protractor_web_test_suite rule
var bazelBundle = document.location.search.endsWith('debug') ? 'bundle.min_debug.js' : 'bundle.min.js';
document.write('<script src="' + bazelBundle + '">\u003c/script>');
var mainUrl = window.location.search.split(/[?&]main=([^&]+)/)[1]
|| '../../bootstrap_ng2.js';
document.write('<script src="' + (isBazel ? bazelBundle : mainUrl) + '">\u003c/script>');
</script>
</body>

View File

@ -27,4 +27,10 @@ export function main() {
}
}
main();
const isBazel = location.pathname.indexOf('/all/') !== 0;
// isBazel needed while 'scripts/ci/test-e2e.sh test.e2e.protractor-e2e' is run
// on Travis
// TODO: port remaining protractor e2e tests to bazel protractor_web_test_suite rule
if (isBazel) {
main();
}

View File

@ -8,6 +8,9 @@
// Determine if we run under bazel
const isBazel = !!process.env.RUNFILES;
// isBazel needed while 'scripts/ci/test-e2e.sh test.e2e.protractor-e2e' is run
// on Travis
// TODO: port remaining protractor e2e tests to bazel protractor_web_test_suite rule
// Make sure that the command line is read as the first thing
// as this could exit node if the help script should be printed.