Skip to content

Commit a458150

Browse files
committed
Run canary tests in presubmit
This partially addresses #128 [email protected] Review URL: https://codereview.chromium.org/1208413003
1 parent 7837d31 commit a458150

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

pkg/dev_compiler/.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ before_script:
1616
- npm install
1717
script:
1818
- ./tool/presubmit.sh
19-
- ./node_modules/karma/bin/karma start --single-run
2019
- ./tool/coverage.sh

pkg/dev_compiler/tool/browser_test.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Check that node exists and refers to nodejs
4+
checknodejs=$(hash node 2> /dev/null && node --help | grep nodejs)
5+
if [[ $? -ne 0 ]]; then
6+
echo 'NodeJS (node) is not properly installed'
7+
echo 'Note, on Ubuntu / Debian, you may need to also install:'
8+
echo '$ sudo apt-get install nodejs-legacy'
9+
exit 1
10+
fi
11+
12+
# Check that npm is installed
13+
checknpm=$(hash npm 2> /dev/null)
14+
if [[ $? -ne 0 ]]; then
15+
echo 'Node Package Manager (npm) is not properly installed'
16+
exit 1
17+
fi
18+
19+
# Check for Chrome Canary on Ubuntu
20+
# The default install path is sometimes google-chrome-unstable
21+
# instead of google-chrome-canary as karma expects.
22+
if [[ "$OSTYPE" == "linux-gnu" ]] && [[ -z "$CHROME_CANARY_BIN" ]]; then
23+
checkcanary=$(hash google-chrome-canary 2> /dev/null)
24+
if [[ $? -ne 0 ]]; then
25+
checkunstable=$(hash google-chrome-unstable 2> /dev/null)
26+
if [[ $? -ne 0 ]]; then
27+
echo 'Chrome Canary is not found'
28+
echo 'Please install and/or set CHROME_CANARY_BIN to its path'
29+
exit 1
30+
else
31+
export CHROME_CANARY_BIN=google-chrome-unstable
32+
fi
33+
fi
34+
fi
35+
36+
npm install
37+
npm test

pkg/dev_compiler/tool/presubmit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ set -e
33
DIR=$(dirname "${BASH_SOURCE[0]}")
44
$DIR/build_sdk.sh
55
$DIR/test.sh
6+
$DIR/browser_test.sh
67
$DIR/analyze.sh
78
$DIR/format.sh

0 commit comments

Comments
 (0)