Skip to content
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

Merged
merged 50 commits into from
Feb 20, 2018

Conversation

funkyboy
Copy link
Contributor

@funkyboy funkyboy commented Jan 23, 2018

Adding BrowserStack for karma tests.
Fix #449
Fix #460
Fix #465

  • add script for CI
  • add more combinations of os/browsers
  • inspect with IE hits timeouts and takes 4x than Firefox tests
  • remove local Firefox
  • add all browsers to CI script (in batches)
  • add Safari for Mac
  • add one Android device
  • Set up Travis to run 2 jobs (see Pick on CI to run unit and browser tests on #460 (comment))
  • Re-add local Firefox

@funkyboy
Copy link
Contributor Author

IE10 issues have been fixed here: #453

@SimonWoolf
Copy link
Member

SimonWoolf commented Jan 26, 2018

IE10 issues have been fixed here

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.

@@ -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
Copy link
Contributor Author

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. :(

Copy link
Contributor Author

@funkyboy funkyboy Feb 8, 2018

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

@funkyboy
Copy link
Contributor Author

funkyboy commented Feb 8, 2018

We hit Travis 50m timeout also when removing iOS10 tests, thus running tests on 8 browsers (plus nodeunit).

@funkyboy funkyboy force-pushed the add-browserstack-testing branch from e463217 to 492e6d1 Compare February 9, 2018 14:49
@funkyboy funkyboy changed the title WIP: Add BrowserStack config for karma WIP: Run Karma tests with BrowserStack and reconfigure Travis Feb 14, 2018
@funkyboy funkyboy changed the title WIP: Run Karma tests with BrowserStack and reconfigure Travis Run Karma tests with BrowserStack and reconfigure Travis Feb 14, 2018
Copy link
Member

@paddybyers paddybyers left a 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

Copy link
Member

@SimonWoolf SimonWoolf left a 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: {
Copy link
Member

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

Copy link
Contributor Author

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,
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@SimonWoolf SimonWoolf Feb 20, 2018

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

Copy link
Contributor Author

@funkyboy funkyboy Feb 20, 2018

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"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answering myself: yes :)

@@ -0,0 +1,3 @@
grunt test:nodeunit
Copy link
Member

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)

Copy link
Contributor Author

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

Copy link
Member

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
}
};
Copy link
Member

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)

Copy link
Contributor Author

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,
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonWoolf Added

@funkyboy
Copy link
Contributor Author

@SimonWoolf one last check before merging?

@SimonWoolf
Copy link
Member

👍 . 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

@funkyboy
Copy link
Contributor Author

@SimonWoolf that was the result of of using GH web UI to resolve a conflict :(

@funkyboy funkyboy force-pushed the add-browserstack-testing branch 2 times, most recently from 3dc079c to 2fb08e8 Compare February 20, 2018 14:04
@funkyboy funkyboy force-pushed the add-browserstack-testing branch from 2fb08e8 to ae67028 Compare February 20, 2018 14:14
@funkyboy
Copy link
Contributor Author

@SimonWoolf here you go

@SimonWoolf SimonWoolf merged commit 9ea1585 into master Feb 20, 2018
@SimonWoolf SimonWoolf deleted the add-browserstack-testing branch February 20, 2018 14:23
@SimonWoolf
Copy link
Member

Thanks @funkyboy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants