-
Notifications
You must be signed in to change notification settings - Fork 56
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
Run Karma tests with BrowserStack and reconfigure Travis #452
Conversation
IE10 issues have been fixed here: #453 |
To be clear, those appear to have been regressions introduced since a couple years ago (genuine bugs affecting IE10), rather than the IE10 problems we had with saucelabs/testingbot that couldn't be reproduced in local vms (and which, as #449 notes, caused every test after some initial number to time out with connectivity issues, rather than only the crypto tests). Looking forward to seeing how we fare now on saucelabs or browserstack. |
fc7ec88
to
a21795d
Compare
test/bin/ci-travis-all.sh
Outdated
@@ -1,3 +1,3 @@ | |||
grunt $B0 | |||
grunt test:karma --browsers bs_firefox_sierra,bs_chrome_sierra,bs_ie11_win81,bs_ie10_win81 | |||
grunt test:karma --browsers $B1 | |||
grunt test:karma --browsers bs_ie9_win7,bs_ie16_win10,bs_safari_10_3,bs_safari_11 |
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 would be nice but as soon as $B0
(nodeunit) tests end, Travis starts running the script on line 3. But given that line 2 has not finished yet, BrowserStack will hang, because we are allowed at most 5 tests in parallel. :(
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.
When running tests in a serial fashion, we hit travis (.org) limits of 50m per build. Sequence tested:
- nodeunit
- bs_firefox_sierra,bs_chrome_sierra,bs_ie11_win81,bs_ie10_win81
- bs_ie9_win7,bs_ie16_win10,bs_safari_10_3,bs_safari_11
Example here: https://api.travis-ci.org/v3/job/338955785/log.txt
We hit Travis 50m timeout also when removing iOS10 tests, thus running tests on 8 browsers (plus nodeunit). |
e463217
to
492e6d1
Compare
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'll defer to @SimonWoolf
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.
lgtm with comments 👍
Now the bigger piece of work: fixing the bugs and intermittent tests that this exposes
karma.conf.js
Outdated
browserName: 'internet explorer', | ||
platform: 'Windows 7', | ||
version: '10' | ||
bs_safari_10_3: { |
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.
consistent naming: OS not just version, eg bs_safari_iOS_10_3
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.
@SimonWoolf My bad. This is not referenced in the the travis file. Will substitute it with IE8.
karma.conf.js
Outdated
@@ -166,24 +169,14 @@ module.exports = function(config) { | |||
|
|||
// level of logging | |||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | |||
logLevel: config.LOG_INFO, | |||
logLevel: process.env.ABLY_LOG_LEVEL, |
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.
Not sure why you made this change? It won't work -- karma log level is an enum whose values are uppercase strings; Ably log level is an integer
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.
@SimonWoolf That's why it doesn't work :)
Goal was to keep the Travis log shorter. Will set to WARN
to see what happens.
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.
karma INFO-level logs add around 10 lines to the beginning of the test; the remaining ~40k lines are mostly from ably-js Logger. I'd focus on the 40k rather than cutting those 10 lines down to 5 ☺. Check out the envPreprocessor
config line for exposing external env vars to karma tests
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.
@SimonWoolf Oh so this doesn't work because ABLY_LOG_LEVEL
doesn't appear in the envPreprocessor
"enumeration"?
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.
Answering myself: yes :)
test/bin/ci-travis-all.sh
Outdated
@@ -0,0 +1,3 @@ | |||
grunt test:nodeunit |
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.
No point duplicating the nodeunit tests in the browserstack run. (If you're only doing that get the concat task, you can just do grunt concat
directly. have a look in the gruntfile to see what tasks do what)
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.
@SimonWoolf True, but browser tests failed if not preceded by nodeunit tests because of #462
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.
No, grunt concat
doesn't run the minifier, so is unaffected by #462.
os: 'android', | ||
os_version: '6.0', | ||
device: 'Google Nexus 6', | ||
real_mobile: 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.
No IE8? (I'm not against dropping IE8 if usage numbers are finally low enough, but that should be a deliberate decision, as long as we claim we support it we should be testing on it)
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.
@SimonWoolf Fixing. See above.
} | ||
}; | ||
|
||
config.set({ | ||
|
||
browserStack: { | ||
username: process.env.BROWSERSTACK_USERNAME, | ||
accessKey: process.env.BROWSERSTACK_ACCESSKEY, |
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.
Would be convenient if these were in the private repo in a script in sourcable
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.
@SimonWoolf Added
@SimonWoolf one last check before merging? |
👍 . Git history's a bit messed up though, why is there a commit merging master into this branch? Get rid of that and rebase this on master, and regen package-lock.json. Let me know when done and I'll check it and merge |
@SimonWoolf that was the result of of using GH web UI to resolve a conflict :( |
3dc079c
to
2fb08e8
Compare
2fb08e8
to
ae67028
Compare
@SimonWoolf here you go |
Thanks @funkyboy |
Adding BrowserStack for karma tests.
Fix #449
Fix #460
Fix #465