Commit Graph

6651 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
490cc78a87
Build: Run tests on Node 22 & 23
Closes gh-5560

(cherry picked from commit 1971625487)
2024-10-21 19:05:33 +02:00
Michał Gołębiowski-Owczarek
d41f0cd982
Docs: Update CONTRIBUTING.md
Some checks failed
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_9) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Opera_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_12) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_13) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_14) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_15) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_16) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_17) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_8) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_9) (push) Has been cancelled
Filestash / Update Filestash (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:amd) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:no-deprecated) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:selector-native) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:slim) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome/Firefox, 20.x, test:browser) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (new), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (old), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 18.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, lint) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, test:browserless) (push) Has been cancelled
Node / test:ie - IE (push) Has been cancelled
Node / test:safari - Safari (push) Has been cancelled
Changes:
1. Update the link to "help wanted" or "patch welcome" issues to only include
   open ones.
2. Replace info about the jQuery Forum & IRC with Matrix & Stack Overflow.
3. Update the test reduction WebKit blog post link.
4. Update the Git clone instructions to not rely on the legacy `git://`
   protocol.
5. Fix a few typos.

Closes gh-5564

(cherry picked from commit 4ef25b0de4)
2024-10-14 18:45:20 +02:00
neogy-akash
ce7db4adf0
Build: Enforce ECMAScript 5 in tests via ESLint
Fixes gh-5542
Closes gh-5563

(cherry picked from commit d74fc265de)
2024-10-09 18:27:45 +02:00
Michał Gołębiowski-Owczarek
92a437bed2
Tests: Switch to an updated fork of promises-aplus-tests
Some checks failed
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_9) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Opera_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_12) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_13) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_14) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_15) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_16) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_17) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_8) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_9) (push) Has been cancelled
Filestash / Update Filestash (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:amd) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:no-deprecated) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:selector-native) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:slim) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome/Firefox, 20.x, test:browser) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (new), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (old), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 18.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, lint) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, test:browserless) (push) Has been cancelled
Node / test:ie - IE (push) Has been cancelled
Node / test:safari - Safari (push) Has been cancelled
The upstream package has been unmaintained for years, with dependencies
with long-reported security issues. Switching to a fork allows to resolve
all the security reports against the jQuery development environment.

The fork is maintained by @mgol and has the following changes:
1. The `underscore` dependency has been removed.
2. `sinon` has been updated from v1 to v19.
3. `mocha` has been updated from v2 to v10.

Changes to the source are minimal; it will be easy to rebase the fixes
if the upstream package is ever updated.

In addition to the above, the `q` dependency has been removed.
It's been added in gh-1996 but never really used.

Closes gh-5559

(cherry picked from commit 559bc5ac58)
2024-09-30 18:54:51 +02:00
ac-mmi
752e9119ab
Manipulation: Make jQuery.cleanData not skip elements during cleanup
When passing a result of `getElementByTagsName` to `jQuery.cleanData`, convert
it to an array first. Otherwise, a live NodeList is passed and if any of the
event cleanups remove the element itself, a collection is modified during the
iteration, making `jQuery.cleanData` skip cleanup for some elements.

Fixes gh-5214
Closes gh-5523

Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

(cherry picked from commit 3cad5c435a)
2024-09-11 00:27:16 +02:00
Michał Gołębiowski-Owczarek
fb281ca8ca
Tests: Run tests in Edge in IE mode in GitHub Actions
While Edge in IE mode is not guaranteed to match IE 11 in every aspect,
in practice it generally does. Testing in this mode in GitHub Actions
will allow us to catch most IE-breaking issues at the PR level.

This change also adds missing npm scripts: `test:chrome`, `test:edge`
& `test:ie`.

Closes gh-5540

(cherry picked from commit 6d78c0768d)
2024-09-09 18:26:59 +02:00
Michał Gołębiowski-Owczarek
6c7f755452
Tests: Run tests on both real Firefox ESRs
1. At the same time, there may be two supported versions of Firefox ESR. Run
   tests on both, installed locally.
2. Contrary to what we did in gh-5547, still run tests on Firefox 115 on
   BrowserStack - on `main`, we deleted it since we support only the versions
   supported upstream. In jQuery 3.x, we're testing on all versions matching ESR
   lines starting with Firefox 48, so for consistency let's keep Firefox 115
   there as well.

Closes gh-5548
Ref gh-5547
2024-09-06 18:49:52 +02:00
Timmy Willison
8037b9f53e Tests: align mock.php with main branch (sans spacing diffs)
Ref gh-5531
2024-08-24 10:05:01 -04:00
Timmy Willison
ed18576506 Tests: replace dead links in qunit fixture; use https
Ref gh-5531
2024-08-24 10:05:01 -04:00
Timmy Willison
b4ab47afd7 Tests: replace express with basic Node server
Closes gh-5531
2024-08-24 10:05:01 -04:00
dependabot[bot]
af599d0d63
Build: Bump actions/setup-node from 4.0.2 to 4.0.3
Closes gh-5528

Updates `actions/setup-node` from 4.0.2 to 4.0.3
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4.0.2...1e60f620b9541d16bece96c5465dc8ee9832be0b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

(cherry picked from commit 55bc35bcd4)
2024-08-01 11:08:20 +02:00
Timmy Willison
0b013ca940 Build: upgrade dependencies, including requirejs to 2.3.7 2024-07-29 15:25:14 -04:00
Timmy Willison
fca1c56f15 Build: use --input-type=module in npm scripts
Ref gh-5522
2024-07-29 15:25:14 -04:00
Timmy Willison
2cf659189e Release: migrate release process to release-it
*Authors*
- Checking and updating authors has been migrated
  to a custom script in the repo

*Changelog*
- changelogplease is no longer maintained
- generate changelog in markdown for GitHub releases
- generate changelog in HTML for blog posts
- generate contributors list in HTML for blog posts

*dist*
- clone dist repo, copy files, and commit/push
- commit tag with dist files on main branch;
  remove dist files from main branch after release

*cdn*
- clone cdn repo, copy files, and commit/push
- create versioned and unversioned copies in cdn/
- generate md5 sums and archives for Google and MSFT

*build*
- implement reproducible builds and verify release builds
  * uses the last modified date for the latest commit
  * See https://reproducible-builds.org/
- the verify workflow also ensures all files were
  properly published to the CDN and npm

*docs*
- the new release workflow is documented at build/release/README.md

*verify*
- use the last modified date of the commit before the tag
- use versioned filenames when checking map files on the CDN
- skip factory and package.json files when verifying CDN

*misc*
- now that we don't need the jquery-release script and
  now that we no longer need to build on Node 10, we can
  use ESM in all files in the build folder
- limit certain workflows to the main repo (not forks)
- version has been set to the previously released version 3.7.1,
  as release-it expects
- release-it added the `preReleaseBase` option and we
  now always set it to `1` in the npm script. This is
  a noop for stable releases.
- include post-release script to be run manually after a release,
  with further steps that should be verified manually

Ref jquery/jquery-release#114
Closes gh-5522
2024-07-29 15:25:14 -04:00
dependabot[bot]
3b2330240c
Build: Bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

Updates `actions/checkout` from 4.1.6 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

Closes gh-5515

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

(cherry picked from commit 3a98ef91df)
2024-07-05 18:48:12 +02:00
Timmy Willison
fc864c83c8
Build: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7
- Sinon is already at the latest version that supports IE9.
- Upgraded uglify to 3.7.7, which is the latest that worked with IE9.
  I tried 3.9.4, which we are using in jquery-migrate, and 3.8.1,
  but there were failures in traversing ("Permission denied" errors).
- Upgraded eslint to version 9, which required some changes.
  Mainly, unused arguments in catch expressions error by default in 9+.
  The config now makes use of `caughtErrorsIgnorePattern`,
  which is set to `"^_"`, the same as unused function params.
- Ignored main branch dist files when switching branches.

Closes gh-5508
2024-06-15 09:10:59 -04:00
Timmy Willison
8eb35e8513
Tests: fix supportsScroll feature test in offset
- iOS 12 and below do not support scrollTop/Left on the
  window or document. Before 82169df, window.supportsScroll
  was always undefined. There were 2 issues: (1) iOS <=12 do
  support scroll props on the body, so the support test
  wasn't helpful. (2) one test checked the wrong window and
  the value was always undefined, which meant those tests
  never ran in any browser.

Closes gh-5506
2024-06-10 14:50:28 -04:00
Timmy Willison
82169df010
Build: improve specificity of eslint config; add ecma versions
- also added no-implicit-globals rule outside of tests,
  but including dist

Close gh-5504
2024-06-10 09:01:53 -04:00
dependabot[bot]
efa1e0a131
Build: Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).

Updates `actions/checkout` from 4.1.2 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9bb56186c3...a5ac7e51b4)

Updates `github/codeql-action` from 3.24.9 to 3.25.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b1aada464...2e230e8fe0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Closes gh-5505

(cherry picked from commit 46b9e4803e)
2024-06-06 00:09:47 +02:00
Michał Gołębiowski-Owczarek
a27d038818
Build: Group dependabot PRs updating GitHub Actions
We have monthly automatic dependabot PRs for GitHub Actions. Unfortunately,
as of now we get a separate PR for every dependency which is a bit spammy
compared to regular commits updating source.

Thankfully, there's now a way to tell dependabot to submit a single PR per
a defined group. This change defines a single group to have a single dependabot
PR for all action updates.

Closes gh-5503

(cherry picked from commit 3cac1465b4)
2024-06-06 00:00:56 +02:00
Michał Gołębiowski-Owczarek
29a9030c78
CSS:Tests: Fix tests & support tests under CSS Zoom (3.x version)
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes gh-5489
Closes gh-5496
Ref gh-5495
2024-06-03 18:15:39 +02:00
Michał Gołębiowski-Owczarek
b6f53def96
Tests: Make :has selector tests not vulnerable to unrelated failures
Use `assert.selectInFixture` consistently in `:has` tests. Previously, any test
failure that happened before this test run made it fail due to an additional
paragraph with id `qunit-testresult` injected by QUnit.

Closes gh-5497
2024-05-29 18:32:27 +02:00
Timmy Willison
a5bac65e0c
Tests: revert concurrency group change
- It's common for us to merge to main and cherry pick to 3.x-stable,
  so it's best if concurrency is shared between branches, which
  is effectively what we had already as it matches on workflow name
  and browser. Ideally, it could also match on the corresponding commit,
  but it seems the commit message is not available in the github context.

Close gh-5493
2024-05-29 11:06:42 -04:00
Michał Gołębiowski-Owczarek
37bded3522
Event: Increase robustness of an inner native event in leverageNative
In Firefox, alert displayed just before blurring an element dispatches
the native blur event twice which tripped the jQuery logic if a jQuery blur
handler was not attached before the trigger call.

This was because the `leverageNative` logic part for triggering first checked if
setup was done before (which, for example, is done if a jQuery handler was
registered before for this element+event pair) and - if it was not - added
a dummy handler that just returned `true`. The `leverageNative` logic made that
`true` then saved into private data, replacing the previous `saved` array. Since
`true` passed the truthy check, the second native inner handler treated `true`
as an array, crashing on the `slice` call.

The same issue could happen if a handler returning `true` is attached before
triggering. A bare `length` check would not be enough as the user handler may
return an array-like as well. To remove this potential data shape clash, capture
the inner result in an object with a `value` property instead of saving it
directly.

Since it's impossible to call `alert()` in unit tests, simulate the issue by
replacing the `addEventListener` method on a test button with a version that
calls attached blur handlers twice.

Fixes gh-5459
Closes gh-5466
Ref gh-5236

(cherry picked from commit 527fb3dcf0)
2024-05-20 18:05:38 +02:00
Timmy Willison
18adf66b44
Tests: include github ref in concurrency group
- fixes cancelled workflows when multiple PRs are merged
  in quick succession to both the main and 3.x-stable branches

Close gh-5482
2024-04-25 13:08:13 -04:00
Michał Gołębiowski-Owczarek
5d83fadb6b
Tests: Make the beforeunload event tests work regardless of extensions
Some browser extensions, like React DevTools, send messages to the content area.
Since our beforeunload event test listens for all messages, it used to catch
those as well, failing the test.

Add a `source` field to the payload JSON and check for it before treating the
message as coming from our own test to make sure the test passes even with such
browser extensions installed.

Closes gh-5478

(cherry picked from commit 399a78ee9f)
2024-04-25 00:25:27 +02:00
Michał Gołębiowski-Owczarek
5d5872bd58
Docs: Update remaining HTTP URLs to HTTPS
Update a few remaining HTTP URLs to HTTPS. The only ones left are XMLNS-like
URLs or ones to localhost - those need to stay as-is.

Closes gh-5479

(cherry picked from commit 7cdd837423)
2024-04-25 00:24:08 +02:00
dependabot[bot]
834b5bc6bb
Build: Bump actions/cache & actions/checkout
1. Bump actions/cache from 4.0.1 to 4.0.2

Bumps [actions/cache](https://github.com/actions/cache) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](ab5e6d0c87...0c45773b62)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

2. Bump actions/checkout from 4.1.1 to 4.1.2

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](b4ffde65f4...9bb56186c3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Closes gh-5462

Signed-off-by: dependabot[bot] <support@github.com>

(partially cherry picked from commit df1df9503a)
2024-04-02 23:39:23 +02:00
Timmy Willison
cc44f76834
Tests: share queue/browser handling for all worker types
- one queue to rule them all: browserstack, selenium, and jsdom
- retries and hard retries are now supported in selenium
- selenium tests now re-use browsers in the same way as browserstack

Close gh-5465
2024-04-01 12:34:13 -04:00
Timmy Willison
feb75d3072
Tests: improve diffing for values of different types
Close gh-5455

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2024-03-27 12:18:37 -04:00
dependabot[bot]
953ff7172c
Build: Bump actions/cache from 4.0.0 to 4.0.1
Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](13aacd865c...ab5e6d0c87)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Close gh-5424

(cherry picked from commit 68f772e003)
2024-03-20 00:43:00 +01:00
Timmy Willison
36a43de3b7
Tests: show any and all actual/expected values
Close gh-5449
2024-03-15 17:44:21 -04:00
Timmy Willison
8350e5c63f
Tests: add diffing to test reporter
Close gh-5446
2024-03-14 14:28:38 -04:00
Timmy Willison
f8be4a52c0
Tests: add actual and expected messages to test reporter
Close gh-5444
2024-03-14 09:05:57 -04:00
Timmy Willison
d926cca9c6 Tests: fix worker restarts for failed browser acknowledgements
Close gh-5441
2024-03-11 13:36:09 -04:00
Timmy Willison
b56c6a415e Build: make compare size cache readable for manual edits
Ref gh-5441
2024-03-11 13:36:09 -04:00
Timmy Willison
fa3f5603d8 Build: fix size comparison for slim files when the branch is dirty
Ref gh-5441
2024-03-11 13:36:09 -04:00
Timmy Willison
79a19b412c Build: migrate more uses of fs.promises; use node: protocol
Ref gh-5441
2024-03-11 13:36:09 -04:00
Timmy Willison
2d8208e007
Tests: add --hard-retries option to test runner
- Add the ability to retry by restarting the worker and
  getting a different browser instance, after all
  normal retries have been exhausted. This can sometimes
  be successful when a refresh is not.

Close gh-5439
2024-03-11 10:45:17 -04:00
Timmy Willison
11f0e6335e Tests: fix cleanup in cases where server doesn't stop 2024-03-09 10:36:33 -05:00
Timmy Willison
79329f5015 Build: drop support for Node 10
Close gh-5437
2024-03-09 10:36:33 -05:00
Timmy Willison
2ab173df6a
Build: add GitHub Actions workflow to update Filestash
Close gh-5435
2024-03-08 15:13:31 -05:00
Timmy Willison
003c958263
Tests: fix flakey message logs; ignore delete worker failures
Close gh-5431
2024-03-05 15:50:37 -05:00
Timmy Willison
ef434cd8d3
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**
- 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
- Browser workers are reused when running isolated modules in the same browser
- 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. Supports latest and latest-\d+ in place of browser version.
- cleans up after itself (closes the local tunnel, stops the test server, etc.)
- Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables.

**Selenium**
- 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-5427
2024-03-05 13:53:39 -05:00
dependabot[bot]
633f688df7
Build: Bump actions/cache from 3.3.2 to 4.0.0
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.2 to 4.0.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](704facf57e...13aacd865c)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Closes gh-5402

Signed-off-by: dependabot[bot] <support@github.com>

(cherry picked from commit bf11739f6c)
2024-02-11 01:48:39 +01:00
Michał Gołębiowski-Owczarek
164c314f88
Tests: Align middleware-mockerver.js with the main branch
Remove a redundant Express-targeted `resp.set` call from the `script` handler
in `middleware-mockserver.js` as was done on the `main` branch.

Closes gh-5413
Ref gh-5397
2024-02-09 18:22:07 +01:00
Timmy Willison
ba6ba5a4c1
Release: use buildDefaultFiles directly and pass version (#5409)
- also add the ability to pass VERSION in env to test final builds
- adjust sha regex to account for lack of shas
- set the version on the dist package.json

Close gh-5408
2024-02-06 10:16:05 -05:00
Timmy Willison
0360ec8e62
Release: remove scripts and dev deps from dist package.json
- this became necessary due to the addition of the prepare script
- scripts aren't needed and don't work in the dist repo

Close gh-5405
2024-02-05 10:38:19 -05:00
Timmy Willison
0dd6490b79
Release: update build command in Release.generateArtifacts
Close gh-5400
2024-01-31 09:18:57 -05:00
Timmy Willison
23a3171dab
Build: migrate grunt authors to a custom script
- the new script pulls all authors from the Sizzle repo
- added temporary grunt task for releases

Close gh-5396
2024-01-22 22:12:33 -05:00