Skip to content

Commit

Permalink
Run CI tests with Node 19
Browse files Browse the repository at this point in the history
* Update Test262 to latest Node19-compatible tests
* Update GH actions to latest versions
* Test262 against Node 14, 16, 18, and 19
* Use Node19 on all other actions and tests
* Extend expected-failures.txt handling so some tests can be expected
  to fail only on some Node versions.
  • Loading branch information
justingrant committed Jan 4, 2023
1 parent bfe35e6 commit 9e682e0
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 41 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: use node.js v15.x
uses: actions/setup-node@v1
with:
node-version: 15.x
- run: npm ci
- run: npm run build
- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: out
CLEAN: true
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 19.x
- run: npm ci
- run: npm run build
- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: out
CLEAN: true
16 changes: 8 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use node.js v15.x
uses: actions/setup-node@v1
with:
node-version: 15.x
- run: npm ci
- run: npm run lint
- run: npm run build:spec
- uses: actions/checkout@v3
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 19.x
- run: npm ci
- run: npm run lint
- run: npm run build:spec
74 changes: 58 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,92 @@ on:
branches:
- main
jobs:
test-polyfill:
test-demitasse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use node.js v18.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 19.x
- run: npm ci
- run: npm run test-demitasse
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
test-test262:
test-test262-node19:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 19.x
- run: npm ci
- run: npm run codecov:test262
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
test-test262-node18:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: use node.js v18.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- run: npm run codecov:test262
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
test-test262-node16:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: use node.js v16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci
- run: npm run codecov:test262
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
test-test262-node14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: use node.js v14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm ci
- run: npm run codecov:test262
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
test-cookbook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use node.js v18.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 19.x
- run: npm ci
- run: npm run test-cookbook
test-validstrings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use node.js v18.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: use node.js v19.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 19.x
- run: npm ci
- run: |
cd polyfill
Expand Down
7 changes: 6 additions & 1 deletion polyfill/runtest262.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import runTest262 from '@js-temporal/temporal-test262-runner';

const nodeVersion = parseInt(process.versions.node.split('.')[0]);
const expectedFailureFiles = ['test/expected-failures.txt'];
if (nodeVersion < 18) expectedFailureFiles.push('test/expected-failures-before-node18.txt');
if (nodeVersion < 16) expectedFailureFiles.push('test/expected-failures-before-node16.txt');

const result = runTest262({
test262Dir: 'test262',
polyfillCodeFile: 'script.js',
expectedFailureFiles: ['test/expected-failures.txt'],
expectedFailureFiles,
testGlobs: process.argv.slice(2)
});

Expand Down
13 changes: 13 additions & 0 deletions polyfill/test/expected-failures-before-node16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Before Node, dateStyle/timeStyle options didn't conflict with other options
intl402/Temporal/Instant/prototype/toLocaleString/options-conflict.js
intl402/Temporal/PlainDate/prototype/toLocaleString/options-conflict.js
intl402/Temporal/PlainDateTime/prototype/toLocaleString/options-conflict.js
intl402/Temporal/PlainTime/prototype/toLocaleString/options-conflict.js
intl402/Temporal/ZonedDateTime/prototype/toLocaleString/options-conflict.js

# Before Node, calling an uncallable value seems to throw a RangeError, not a TypeError
intl402/Temporal/PlainYearMonth/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable.js
intl402/Temporal/PlainMonthDay/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable.js
intl402/Temporal/PlainDate/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable.js
intl402/Temporal/PlainDateTime/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable.js
intl402/Temporal/PlainTime/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable.js
2 changes: 2 additions & 0 deletions polyfill/test/expected-failures-before-node18.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Intl.supportedValuesOf("timeZone") is only available starting in Node 18
intl402/Temporal/TimeZone/supported-values-of.js
1 change: 1 addition & 0 deletions polyfill/test/expected-failures.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# expected failures unrelated to Node versions
intl402/Temporal/TimeZone/prototype/getNextTransition/transition-at-instant-boundaries.js
intl402/Temporal/TimeZone/prototype/getPreviousTransition/transition-at-instant-boundaries.js
2 changes: 1 addition & 1 deletion polyfill/test262
Submodule test262 updated 35 files
+0 −47 harness/temporalHelpers.js
+1 −4 src/decorator/decorator-call-expr-identifier-reference-yield.case
+1 −4 src/decorator/decorator-member-expr-identifier-reference-yield.case
+1 −4 src/decorator/decorator-parenthesized-expr-identifier-reference-yield.case
+1 −0 test/built-ins/String/prototype/isWellFormed/prop-desc.js
+0 −32 test/built-ins/String/prototype/isWellFormed/to-string-primitive.js
+2 −1 test/built-ins/String/prototype/toWellFormed/prop-desc.js
+0 −32 test/built-ins/String/prototype/toWellFormed/to-string-primitive.js
+0 −58 test/built-ins/Temporal/Duration/prototype/add/nanoseconds-to-days-loop-indefinitely-1.js
+0 −71 test/built-ins/Temporal/Duration/prototype/add/nanoseconds-to-days-loop-indefinitely-2.js
+0 −119 test/built-ins/Temporal/Duration/prototype/add/relativeto-zoneddatetime-nanoseconds-to-days-range-errors.js
+51 −37 test/built-ins/Temporal/Duration/prototype/round/nanoseconds-to-days-loop-indefinitely-1.js
+36 −43 test/built-ins/Temporal/Duration/prototype/round/nanoseconds-to-days-loop-indefinitely-2.js
+0 −101 test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-nanoseconds-to-days-range-errors.js
+0 −59 test/built-ins/Temporal/Duration/prototype/subtract/nanoseconds-to-days-loop-indefinitely-1.js
+0 −71 test/built-ins/Temporal/Duration/prototype/subtract/nanoseconds-to-days-loop-indefinitely-2.js
+0 −119 ...built-ins/Temporal/Duration/prototype/subtract/relativeto-zoneddatetime-nanoseconds-to-days-range-errors.js
+0 −59 test/built-ins/Temporal/Duration/prototype/total/nanoseconds-to-days-loop-indefinitely-1.js
+0 −73 test/built-ins/Temporal/Duration/prototype/total/nanoseconds-to-days-loop-indefinitely-2.js
+0 −98 test/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-nanoseconds-to-days-range-errors.js
+0 −59 test/built-ins/Temporal/ZonedDateTime/prototype/since/nanoseconds-to-days-loop-indefinitely-1.js
+0 −71 test/built-ins/Temporal/ZonedDateTime/prototype/since/nanoseconds-to-days-loop-indefinitely-2.js
+0 −102 test/built-ins/Temporal/ZonedDateTime/prototype/since/nanoseconds-to-days-range-errors.js
+0 −59 test/built-ins/Temporal/ZonedDateTime/prototype/until/nanoseconds-to-days-loop-indefinitely-1.js
+0 −71 test/built-ins/Temporal/ZonedDateTime/prototype/until/nanoseconds-to-days-loop-indefinitely-2.js
+0 −102 test/built-ins/Temporal/ZonedDateTime/prototype/until/nanoseconds-to-days-range-errors.js
+2 −9 test/intl402/DateTimeFormat/constructor-no-instanceof.js
+4 −9 test/intl402/DateTimeFormat/prototype/format/no-instanceof.js
+3 −8 test/intl402/DateTimeFormat/prototype/resolvedOptions/no-instanceof.js
+2 −9 test/intl402/NumberFormat/constructor-no-instanceof.js
+4 −10 test/intl402/NumberFormat/prototype/format/no-instanceof.js
+3 −9 test/intl402/NumberFormat/prototype/resolvedOptions/no-instanceof.js
+54 −0 ...age/statements/class/decorator/syntax/valid/class-element-decorator-call-expr-identifier-reference-yield.js
+43 −0 ...e/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-identifier-reference-yield.js
+61 −0 ...ments/class/decorator/syntax/valid/class-element-decorator-parenthesized-expr-identifier-reference-yield.js

0 comments on commit 9e682e0

Please sign in to comment.