-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
CircleCI with Ubuntu 14.04, 2x parallelism and WebGL jasmine tests #1455
Conversation
- use process.env.CIRCLECI to determine if karma is run on CI or not - autoWatch is false on CI - singleRun is true on CI - Chrome 54 (on ubuntu 14.04) is now used on CI !!
- Chrome is now used on CI - highlight that --ignore-gpu-blacklist allow to test WebGL on CI (CircleCI already wraps the process with xfvb) - DRY files array operations
- ... as WebGL is now supported on CI 🎉
- add ci_tesh.sh that splits test command between 2 containers - make `npm run lint` exit with exit code 1 if fails - rm `eval ($node tasks/docker.js ---)` hack (no longer needed in 14.04) - ping imagetest server from outside container, as pinging from inside was failling in 14.04 - add more robust `npm i` step
- unfortunately, still some test need to be skipped on CI e.g. mapbox-gl takes too much resources ant blows up the run and similarly for some parcoords tests.
- which is very useful for debugging as discussed in CONTRIBUTING.md
- so that the CI logs show which tests were skipped - use with 'dots' reporter when not targeting an individual suite for cleaner output.
- the new 2.8.x series breaks the `cwise` transform - see #1450 (comment) - maybe we should make uglify-js a core dependencies then?
- to make it easier to run tests that are skipped on CI and easier to document.
@@ -77,7 +77,7 @@ func.defaultConfig = { | |||
// See note in CONTRIBUTING.md about more verbose reporting via karma-verbose-reporter: | |||
// https://www.npmjs.com/package/karma-verbose-reporter ('verbose') | |||
// | |||
reporters: ['progress'], | |||
reporters: isSingleSuiteRun ? ['progress'] : ['dots', 'spec'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/mlex/karma-spec-reporter for more info.
# tests that aren't run on CI | ||
|
||
# jasmine specs with @noCI tag | ||
npm run citest-jasmine -- tests/*_test.js --tags noCI || EXIT_STATE=$? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very pleased with karma-jasmine-spec-tags
. This ⏫ allow us to run allow the specs with the @noCI
tag. This will make the pre-release process a lot less painful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
- update dev docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link ⬆️ is broken.
See usage here: b42f021
|
||
func.defaultConfig.autoWatch = false; | ||
|
||
func.defaultConfig.browsers = ['Firefox_WindowSized']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So note that Chrome is now used by default both locally and on CI.
We those of you that prefer dev'ing in FF:
npm run test-jasmine -- tests/*_test.js --browsers Firefox_WindowSized
works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @n-riesco
- eval $(node tasks/docker.js run) | ||
- npm run cibuild | ||
override: | ||
- npm install && npm dedupe && npm prune && npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing here is (a lot) more predictable than simply npm install
npm run test-export || EXIT_STATE=$? | ||
npm run test-syntax || EXIT_STATE=$? | ||
npm run lint || EXIT_STATE=$? | ||
exit $EXIT_STATE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important: I chose this || EXIT_STATE=$?
pattern over #!/bin/bash -e
because I wanted all tests commands to run even if one of them fails. Note that $?
is the exit code of the previously command. Stuff to the right of ||
is only executed if in the command to the left exits with a non-zero code.
Does anyone know a better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Bash scripting is always a bit weird.
@@ -131,7 +131,7 @@ | |||
"read-last-lines": "^1.1.0", | |||
"requirejs": "^2.3.1", | |||
"through2": "^2.0.3", | |||
"uglify-js": "^2.7.5", | |||
"uglify-js": "~2.7.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #1450 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably open an issue in cwise
about this.
@@ -131,7 +131,7 @@ | |||
"read-last-lines": "^1.1.0", | |||
"requirejs": "^2.3.1", | |||
"through2": "^2.0.3", | |||
"uglify-js": "^2.7.5", | |||
"uglify-js": "~2.7.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably open an issue in cwise
about this.
- npm run test-syntax | ||
- eslint . | ||
- ./tasks/ci_test.sh: | ||
parallel: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -16,7 +16,7 @@ Plotly.register([ | |||
require('@lib/contourgl') | |||
]); | |||
|
|||
describe('Test hover and click interactions', function() { | |||
describe('@noCI Test hover and click interactions', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one here should work on CI. I'll investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #1459
test/jasmine/tests/parcoords_test.js
Outdated
@@ -219,7 +219,7 @@ describe('parcoords initialization tests', function() { | |||
}); | |||
}); | |||
|
|||
describe('parcoords', function() { | |||
describe('@noCI parcoords', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monfera this suite here blows the process on CI.
Maybe next time you play around with the parcoords
code you could try to investigate which it
(s) exactly blow(s) up the process. Or better yet, try to make the test less resource intensive. Thanks in advance!
- npm prune && npm ls | ||
- npm run docker -- run | ||
- npm run cibuild | ||
- npm run docker -- setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the docker commands are split between other commands. This is reduce the risk of race conditions.
package.json
Outdated
"docker": "node tasks/docker.js", | ||
"pretest": "node tasks/pretest.js", | ||
"test-jasmine": "karma start test/jasmine/karma.conf.js", | ||
"citest-jasmine": "karma start test/jasmine/karma.ciconf.js", | ||
"citest-jasmine": "CIRCLECI=0 karma start test/jasmine/karma.conf.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
-
addcross-env
to get this to work on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to fix whatever checks the CIRCLECI
var. It's confusing to see CIRCLECI=0
on CircleCI. (If it needs to be this way, can you add a comment?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right. Thanks for checking!
npm run citest-jasmine
is now effectively obsolete. But the CI and local case can now be handled via npm run test-jasmine
.
I kept "citest-jasmine"
to not perturb workflows for other devs. But if I get enough 👍 I will gladly 🔪 it.
Moreover, this should really be:
"citest-jasmine": "CIRCLECI=1 karma start test/jasmine/karma.conf.js",
but funny story !!"0"
in JS evaluates to true
, not to be confused with !!0
which is false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of which it's probably not work bringing in cross-env
for some obsolete script. 🔪
- no need to set the CIRCLECI env variable again.
resolves #241
Big news in CircleCI land !!!
Our tests are now running on an Ubuntu 14.04 build image on CircleCI. Previously we were using a (now very outdated) Ubuntu 12.04 build image.
This build image comes with Chrome 54 by installed by default. This is big news because this Chrome version can create a WebGL context using the
--ignore-gpu-blacklist
(which we were setting previously, but wasn't functional). That is, our WebGL jasmine tests can now run on CI 🎉 - which for all intents and purposes close #241.With the WebGL suites
npm run test-jasmine
now takes more than 5 minutes to run on CI, bringing our total CI run time to above 15 minutes which is kind of slow 🐢 . Needless to say, this was a good time to add 2x parallelism to our CI builds 🏎️ . With 2x parallelism the total build times are back to about 10 minutes. See commit 14621e1 for more info.Unfortunately, some jasmine tests still need to be skipped namely the
mapbox
suites (which are very resource intensive and end up blowing up the process) and similar for someparcoords
tests (cc @monfera). Luckily thekarma-spec-tags
plugin made skipping those few tests on CI very easy 🍸