Commit Graph

28 Commits

Author SHA1 Message Date
Timmy Willison
dfc693ea25
Tests: migrate testing infrastructure to minimal dependencies
This is a complete rework of our testing infrastructure. The main goal is to modernize and drop deprecated or undermaintained dependencies (specifically, grunt, karma, and testswarm). We've achieved that by limiting our dependency list to ones that are unlikely to drop support any time soon. The new dependency list includes:

- `qunit` (our trusty unit testing library)
- `selenium-webdriver` (for spinning up local browsers)
- `express` (for starting a test server and adding middleware)
  - express middleware includes uses of `body-parser` and `raw-body`
- `yargs` (for constructing a CLI with pretty help text)
- BrowserStack (for running each of our QUnit modules separately in all of our supported browsers)
  - `browserstack-local` (for opening a local tunnel. This is the same package still currently used in the new Browserstack SDK)
  - We are not using any other BrowserStack library. The newest BrowserStack SDK does not fit our needs (and isn't open source). Existing libraries, such as `node-browserstack` or `browserstack-runner`, either do not quite fit our needs, are under-maintained and out-of-date, or are not robust enough to meet all of our requirements. We instead call the [BrowserStack REST API](https://github.com/browserstack/api) directly.

## BrowserStack Runner
- automatically retries individual modules in case of test failure(s)
- automatically attempts to re-establish broken tunnels
- automatically refreshes the page in case a test run has stalled
- runs all browsers concurrently and uses as many sessions as are available under the BrowserStack plan. It will wait for available sessions if there are none.
- supports filtering the available list of browsers by browser name, browser version, device, OS, and OS version (see `npm run test:unit -- --list-browsers` for more info). It will retrieve the latest matching browser available if any of those parameters are not specified.
- cleans up after itself (closes the local tunnel, stops the test server, etc.)
- Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables.

## Selenium Runner
- supports running any local browser as long as the driver is installed, including support for headless mode in Chrome, FF, and Edge
- supports running `basic` tests on the latest [jsdom](https://github.com/jsdom/jsdom#readme), which can be seen in action in this PR (see `test:browserless`)
- Node tests will run as before in PRs and all non-dependabot branches, but now includes tests on real Safari in a GH actions macos image instead of playwright-webkit.
- can run multiple browsers and multiple modules concurrently

Other notes:
- Stale dependencies have been removed and all remaining dependencies have been upgraded with a few exceptions:
  - `sinon`: stopped supporting IE in version 10. But, `sinon` has been updated to 9.x.
  - `husky`: latest does not support Node 10 and runs on `npm install`. Needed for now until git builds are migrated to GitHub Actions.
  - `rollup`: latest does not support Node 10. Needed for now until git builds are migrated to GitHub Actions.
- BrowserStack tests are set to run on each `main` branch commit
- `debug` mode leaves Selenium browsers open whether they pass or fail and leaves browsers with test failures open on BrowserStack. The latter is to avoid leaving open too many sessions.
- This PR includes a workflow to dispatch BrowserStack runs on-demand
- The Node version used for most workflow tests has been upgraded to 20.x
- updated supportjQuery to 3.7.1

Run `npm run test:unit -- --help` for CLI documentation

Close gh-5418
2024-02-26 09:42:10 -05:00
Timmy Willison
77d6ad7172
Docs: update watch task in CONTRIBUTING.md
Close gh-5331
2023-09-20 18:10:57 -04:00
Timmy Willison
924b7ce825
Docs: add link to patchwelcome and help wanted issues 2022-06-27 12:15:59 -04:00
Timmy Willison
683ceb8ff0
Docs: add link to preview the new CLAs
Close gh-5009
2022-01-31 22:20:23 +00:00
Michał Gołębiowski-Owczarek
9bdb16cd19
Docs: Update the URL to the latest jQuery build in CONTRIBUTING.md
It used to say https://code.jquery.com/jquery.js but that's a frozen URL
to jQuery 1.11.1. Let's switch that to the URL to the Git build, i.e.
https://releases.jquery.com/git/jquery-git.js.

Closes gh-4972
2021-11-18 22:54:34 +01:00
Michał Gołębiowski-Owczarek
8ae477a432
Build: Rename master to main across the repository
The default branch was updated, this updates the remaining occurrences in code
& comments.

Closes gh-4838
2021-02-05 22:00:56 +01:00
Michał Gołębiowski-Owczarek
d0ce00cdfa
Core: Migrate from AMD to ES modules 🎉
Migrate all source AMD modules to ECMAScript modules. The final bundle
is compiled by a custom build process that uses Rollup under the hood.

Test files themselves are still loaded via RequireJS as that has to work in
IE 11.

Tests can now be run in "Load as modules" mode which replaces the previous
"Load with AMD" option. That option of running tests doesn't work in IE
and Edge as it requires support for dynamic imports.

Some of the changes required by the migration:
* check `typeof` of `noGlobal` instead of using the variable directly
  as it's not available when modules are used
* change the nonce module to be an object as ECMASscript module exports
  are immutable
* remove some unused exports
* import `./core/parseHTML.js` directly in `jquery.js` so that it's not
  being cut out when the `ajax` module is excluded in a custom compilation

Closes gh-4541
2019-11-18 21:15:03 +01:00
Timmy Willison
7fbab88110
Build: jQuery Foundation -> JS Foundation
Close gh-3414
2016-12-05 11:54:38 -05:00
Timmy Willison
dbc4608ed1 Docs: add note about code organization with AMD
Fixes gh-2750
Close gh-2832
2016-01-14 13:09:40 -05:00
Timmy Willison
10c1254d15 Docs: remove compat references 2016-01-14 12:22:45 -05:00
Jon Dufresne
b0b280cd61 Docs: Updated links to https where they are supported.
Close gh-2746
2016-01-13 13:26:10 -05:00
Richard Gibson
605413994f Docs: Reference new feature guidelines and API tenets
Fixes gh-2320
Close gh-2697
2016-01-13 13:22:34 -05:00
Timmy Willison
e0c25abb43 Docs: add a note about loading source with AMD
- Moves the note about the watch task and the note about
  loading with AMD to their own section under
  "Test Suite Tips"

Fixes gh-2714
Close gh-2725
2015-11-17 15:18:58 -05:00
Richard Kraaijenhagen
735dea34fb Docs: "npm run build" was missing from the contributing guides
Close gh-2537
2015-10-12 09:59:39 -04:00
Dave Methvin
bfd5dab2c6 CONTRIBUTING: Condense info and add directions to other resources
Fixes gh-1824
2014-12-04 12:12:24 -05:00
Timmy Willison
758fd6cea9 Docs: 1.x-master branch -> compat branch; 2.x branch -> master branch 2014-11-03 12:34:45 -05:00
Arthur Verschaeve
3e89a53265 Misc: Update all references to bugs.jquery.com
Fixes gh-1681
Closes gh-1716
2014-10-19 23:51:04 +01:00
Amit Merchant
609adf63da CONTRIBUTING: Close parenthesis
Closes gh-1648
2014-09-03 08:45:34 -04:00
Michał Gołębiowski
5801c3a29a Docs: Link to the browser support page in CONTRIBUTING.md
Instead of duplicating the supported browsers matrix, just link to
the browser support page on jquery.com.
2014-01-06 21:14:17 +01:00
Scott González
846771081c CONTRIBUTING: Fixed link to style guide 2013-12-17 09:18:54 -05:00
Michał Gołębiowski
7049877530 Correct oldIE-related comments, revert some workarounds. Close gh-1207. 2013-04-04 12:55:03 -04:00
Ryunosuke SATO
4488f68adf Fix broken link in CONTRIBUTING.md, close gh-1132. 2013-01-20 17:50:18 -05:00
Callum Macrae
c3b1367f4c Fixes to contributing.md. Closes gh-931 2012-09-25 16:19:38 -04:00
Rick Waldron
1474c067f2 CONTRIBUTING.md: more contents links 2012-09-17 14:57:20 -04:00
Rick Waldron
b4d23e4773 CONTRIBUTING.md: adds top header 2012-09-17 14:55:02 -04:00
Rick Waldron
4b469ead3d CONTRIBUTING.md: fixes fragment url, #jquery-core-style-guide 2012-09-17 14:54:24 -04:00
Rick Waldron
42dd6b1c16 Second draft of CONTRIBUTING.md 2012-09-17 14:53:05 -04:00
Rick Waldron
3cb36f7a42 Initial draft of CONTRIBUTING.md 2012-09-17 14:29:58 -04:00