-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Build: support browserstack test #4803
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
Conversation
mgol
left 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.
Thanks for the PR!
We need to be able to pass a specific browser to BrowserStack as well as the latest & previous version, etc. We'll probably want something like https://github.com/jquery/sizzle/blob/master/test/karma/launchers.js defined so that we don't need to inline the launchers in Gruntfile and we need to be able to pass different browsers somehow.
|
Refer to sizzle I made some changes:
However, I encountered some problems when running the test. For example, some test cases failed to be executed during the test using the Firefox browser. I do not know whether the problem is a case problem or a configuration problem. Can you @mgol confirm it? |
|
Have a look at the Travis report: Please have a look at our browser support matrix: https://jquery.com/browser-support/. We only want to run tests on these browsers. |
@mgol Yes, I know. I'm asking why Firefox 78 (ESR) and Firefox 83 fail in browserstack. You can check the Travis report on ygj6/jquery:https://travis-ci.org/github/ygj6/jquery/jobs/750532994, This is run in the browserstack. Travis report on browserstack: |
|
@ygj6 Where do you see these errors? Travis shows old versions of Chrome/Firefox as I mentioned above & I don't see errors anywhere else. |
|
Please check this Travis report on my repository ygj6/jquery: https://travis-ci.org/github/ygj6/jquery/jobs/750532994 In this PR, the The way to generate encryption-keys( |
|
@ygj6 I think you can find the reason here: jquery/test/unit/manipulation.js Lines 2295 to 2303 in a503c69
We need localhost & 127.0.0.1 to resolve to the same address on which Karma runs and I guess that's not the case when we use BrowserStack? We might need to skip that test when BrowserStack is used as well.
|
|
I tested and found these:
Although the request header of browserstack+firefox does not contain jquery/test/unit/manipulation.js Lines 2310 to 2314 in a503c69
We can also use the skip case in the browserstack+firefox scenario. Browser request header details: Browserstack + Firefox 83(no Browserstack + Chrome 87(has FirefoxHeadless(has ChromeHeadless(has PC + Firefox 84(has PC + Chrome 87(has |
We cannot. The whole point of this test is to check whether we got a CORS request which we verify by checking for the We should add that in a comment as it may not be clear why we're checking for the |
|
Now, skipping the cross-domain test in browserstack, all the real browser tests have passed. @mgol Next, do I need to do anything else for this PR? |
mgol
left 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.
@ygj6 some of our tests are flakey so we need a more granular way of restarting jobs that won't re-run all tests in all browsers. In our existing test system, TestSwarm, we can restart each module in each browser, see e.g.: http://swarm.jquery.org/job/11073 (Web Archive link in case it goes down). I'm not sure if we have to be as granular but at least separating browsers would be necessary.
| // it in Karma. | ||
| QUnit[ | ||
| jQuery.ajax && ( window.__karma__ || location.hostname === "localhost" ) ? | ||
| jQuery.ajax && ( ( window.__karma__ && location.hostname !== "bs-local.com" ) || location.hostname === "localhost" ) ? |
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 want this test running in Karma and this condition creates a risk of us skipping it completely. Can you elaborate? Whatever we need to exclude, we need to do it in a safer way.
| - BROWSERS="FirefoxHeadless" | ||
| addons: | ||
| firefox: latest-esr | ||
| - name: "Browser tests: browsertack 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.
A typo + different casing:
| - name: "Browser tests: browsertack tests" | |
| - name: "Browser tests: BrowserStack tests" |
|
Closing & re-opening the PR to trigger the EasyCLA check... |
|
|
It's an honor to contribute to jquery. |
|
@ygj6 Hey, any updates? |
|
Thanks for your contribution. However, this PR has grown stale and will not be needed soon. |
Summary
This week I tried to do something for the jQuery test migration, as follows:
I applied for a free browserstack account, and added browserstack configuration to my fork project. It seems that the jQuery test cases run properly in the real browser (Windows 10 Chrome) provided by the browserstack platform.
Local operation steps:
export BROWSERSTACK_USERNAME=<your browserstack username>export BROWSERSTACK_ACCESS_KEY=<your browserstack access key>npm run test:browserstackoutput:
Next, I plan to continue to do it, such as integrating into github actions, configuring and running more real browsers, etc.;
I look forward to your guidance and suggestions.
Checklist