8000 Run test262 tests in CI by nickva · Pull Request #408 · bellard/quickjs · GitHub
[go: up one dir, main page]

Skip to content

Conversation

nickva
Copy link
Contributor
@nickva nickva commented May 13, 2025

Run test262 tests for Linux, macOS and Cosmopolitan

Add a Makefile test2-bootstrap helper to clone and patch test262 tests at a particular commit. Running with the latest commit noticed a few tests were failing and added them to the errors list.

The CI environment, especially for macOS, was a bit more unpredictable and was failing in atomics tests due to lower timeouts in the atomicsHelper so double the timeouts. The time didn't worsen too much. It still takes about 2-3 min.

@nickva nickva mentioned this pull request May 13, 2025
@nickva nickva force-pushed the run-test262-in-ci branch 12 times, most recently from 8ee7286 to 24e9e37 Compare May 19, 2025 16:19
@nickva nickva force-pushed the run-test262-in-ci branch 4 times, most recently from 9c0da0d to 6960dd5 Compare May 24, 2025 18:30
@nickva nickva force-pushed the run-test262-in-ci branch 2 times, most recently from ab51af9 to 7ca7dc7 Compare June 4, 2025 03:44
@nickva nickva force-pushed the run-test262-in-ci branch 2 times, most recently from 4a07bd7 to 44d52ea Compare June 14, 2025 05:39
nickva added a commit to apache/couchdb that referenced this pull request Jun 15, 2025
Test262 are 70k+ Javascript conformance tests [1].

QuickJS has its own test runner but unfortunately there is not automatic
bootstraping and they run by hand. There is an upstream PR [2] to add these
tests to run there but until that happens we can patch our own QuickJS with.

This particular commit doesn't run the tests just patches the necessary updates
for bootstrapping and some timeout tweaks to fix some flakes.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
nickva added a commit to apache/couchdb that referenced this pull request Jun 15, 2025
Test262 are 70k+ Javascript conformance tests [1].

There is an upstream PR [2] to run these in CI there but until then
can patch our own QuickJS and run them in our CI.

One of the patches we have `04-test262-errors.patch` patches one of the
exception we expect to get since modified the parser to accept the `function`
expression syntax.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
nickva added a commit to apache/couchdb that referenced this pull request Jun 15, 2025
Test262 are 70k+ Javascript conformance tests [1].

There is an upstream PR [2] to run these in CI there but until then
can patch our own QuickJS and run them in our CI.

One of the patches we have `04-test262-errors.patch` patches one of the
exception we expect to get since modified the parser to accept the `function`
expression syntax.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
nickva added a commit to apache/couchdb that referenced this pull request Jun 15, 2025
Test262 are 70k+ Javascript conformance tests [1].

There is an upstream PR [2] to run these in CI there but until then
can patch our own QuickJS and run them in our CI.

One of the patches we have `04-test262-errors.patch` patches one of the
exception we expect to get since modified the parser to accept the `function`
expression syntax.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
@nickva nickva force-pushed the run-test262-in-ci branch 2 times, most recently from 0ced3d2 to 17475ee Compare June 20, 2025 21:09
nickva added a commit to apache/couchdb that referenced this pull request Jun 20, 2025
Test262 are 70k+ Javascript conformance tests [1].

There is an upstream PR [2] to run these in CI there but until then we can
patch our own QuickJS and run them in our CI.

One of the patches we have `04-test262-errors.patch` patches one of the
exception we expect to get since modified the parser to accept the `function`
expression syntax.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
nickva added a commit to apache/couchdb that referenced this pull request Jun 21, 2025
Test262 are 70k+ Javascript conformance tests [1].

There is an upstream PR [2] to run these in CI there but until then we can
patch our own QuickJS and run them in our CI.

One of the patches we have `04-test262-errors.patch` patches one of the
exception we expect to get since modified the parser to accept the `function`
expression syntax.

For now run the test in the full CI only for Linux and skip s390x. Some
architectures/os combinations show various discrepancies around TypedArrays or
rounding errors.

[1] https://github.com/tc39/test262
[2] bellard/quickjs#408
@nickva nickva force-pushed the run-test262-in-ci branch 2 times, most recently from 2b07a0b to 11325a5 Compare June 29, 2025 18:44
@nickva nickva force-pushed the run-test262-in-ci branch 2 times, most recently from 8c30777 to 6f8b450 Compare August 25, 2025 17:49
@nickva
Copy link
Contributor Author
nickva commented Aug 25, 2025

@bellard any interest in having the CI run test262 tests?

I noticed you keep the test262 commit sha in the TODO file but I put it in the Makefile, not sure my approach is good. Maybe it could be a separate file? The idea is to have repeatability if the CI job is re-run and test262 is updated in the meantime.

@bellard
Copy link
Owner
bellard commented Aug 27, 2025

Your approach looks OK. I'll remove the test262 commit sha in TODO ASAP.

@nickva nickva force-pushed the run-test262-in-ci branch from 6f8b450 to 3c38f29 Compare August 29, 2025 03:20
@nickva
Copy link
Contributor Author
nickva commented Aug 29, 2025

Updated with latest test262 from yesterday (2025-09-14). Needed immutable-arraybuffer=skip but otherwise tests pass.

@nickva
Copy link
Contributor Author
nickva commented Sep 18, 2025

Updated it with the latest test262 and it seems to be all green

Screenshot 2025-09-18 at 11 38 14 AM

What do you think, Fabrice, does it need any more changes or tweaks?

@nickva nickva force-pushed the run-test262-in-ci branch 5 times, most recently from 19d8e52 to 0df111b Compare September 25, 2025 01:51
submodules: true
- name: Install gcc-multilib
run: |
sudo apt update
Copy link
Contributor Author
@nickva nickva Sep 26, 2025

Choose a reason for hiding this comment

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

After ubuntu images receive an update for a about a day or two CI will start failing unless the CI jobs perform an apt update so that's why I added it here.

More info at actions/runner-images#12599

@bellard
Copy link
Owner
bellard commented Sep 29, 2025

A last issue before committing: test262 should be run for at least one 32 bit architecture such as Linux x86.

@bellard
Copy link
Owner
bellard commented Sep 29, 2025

you should update the test262 to fix the remaining issue.

Run test262 tests for Linux, macOS and Cosmopolitan

Add a Makefile `test2-bootstrap` helper to clone and patch test262 tests at
a particular commit. Running with the latest commit noticed a few tests were
failing and added them to the errors list.

The CI environment, especially for macOS, was a bit more unpredictable and was
failing in atomics tests due to lower timeouts in the `atomicsHelper` so double
the timeouts. The time didn't worsen too much. It still takes about 2-3 min.
@nickva
Copy link
Contributor Author
nickva commented Sep 29, 2025

Updated, all tests pass, including on 32bit

Screenshot 2025-09-29 at 2 16 48 PM

This is not test262 master though, it's an intermediate commit as there are quite a few changes on master, including the the harness files we patch

@bellard bellard merged commit 4af5b1e into bellard:master Sep 30, 2025
20 checks passed
nickva added a commit to apache/couchdb that referenced this pull request Sep 30, 2025
Upstream merged test262 PR so drop patches related to that:
 bellard/quickjs#408

Other improvements
 * Add set methods (union, difference, intersection, ...)
 bellard/quickjs@a1e073e
 * Add iterators
 bellard/quickjs@982b7aa
 bellard/quickjs@e924173
 bellard/quickjs@b2ed2e9
 bellard/quickjs@cf0e179
 bellard/quickjs@2d99c32
 * Add ArrayBuffer.prototype.transfer
 bellard/quickjs@1e19893
 * Add resizable array buffers
 bellard/quickjs@f021d77
 * Add Map and WeakMap upsert
 bellard/quickjs@456e016
 * Add Map.sumPrecise()
 bellard/quickjs@bc753c6
 bellard/quickjs@c3e5ae2
 * Fix date parsing
 bellard/quickjs@0060876
nickva added a commit to apache/couchdb that referenced this pull request Sep 30, 2025
Upstream merged test262 PR so drop patches related to that:
 bellard/quickjs#408

Other improvements
 * Add set methods (union, difference, intersection, ...)
 bellard/quickjs@a1e073e
 * Add iterators
 bellard/quickjs@982b7aa
 bellard/quickjs@e924173
 bellard/quickjs@b2ed2e9
 bellard/quickjs@cf0e179
 bellard/quickjs@2d99c32
 * Add ArrayBuffer.prototype.transfer
 bellard/quickjs@1e19893
 * Add resizable array buffers
 bellard/quickjs@f021d77
 * Add Map and WeakMap upsert
 bellard/quickjs@456e016
 * Add Map.sumPrecise()
 bellard/quickjs@bc753c6
 bellard/quickjs@c3e5ae2
 * Fix date parsing
 bellard/quickjs@0060876
nickva added a commit to apache/couchdb that referenced this pull request Sep 30, 2025
Upstream merged test262 PR so drop patches related to that:
 bellard/quickjs#408

Other improvements
 * Add set methods (union, difference, intersection, ...)
 bellard/quickjs@a1e073e
 * Add iterators
 bellard/quickjs@982b7aa
 bellard/quickjs@e924173
 bellard/quickjs@b2ed2e9
 bellard/quickjs@cf0e179
 bellard/quickjs@2d99c32
 * Add ArrayBuffer.prototype.transfer
 bellard/quickjs@1e19893
 * Add resizable array buffers
 bellard/quickjs@f021d77
 * Add Map and WeakMap upsert
 bellard/quickjs@456e016
 * Add Map.sumPrecise()
 bellard/quickjs@bc753c6
 bellard/quickjs@c3e5ae2
 * Fix date parsing
 bellard/quickjs@0060876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0