Skip to content
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

✅ Rework checks against legacy node #4269

Merged
merged 66 commits into from Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7147024
✅ Rework checks against legacy node
dubzzz Sep 28, 2023
23562a3
versions
dubzzz Sep 28, 2023
c2fa56d
update lock
dubzzz Sep 28, 2023
7ada7ff
install nvs
dubzzz Sep 28, 2023
e6ed9c6
install nvs
dubzzz Sep 28, 2023
78be408
Update .github/workflows/build-status.yml
dubzzz Sep 28, 2023
415f09e
Merge remote-tracking branch 'origin/main' into legacy-node-check
dubzzz Sep 29, 2023
a2b7853
Merge branch 'legacy-node-check' of https://github.com/dubzzz/fast-ch…
dubzzz Sep 29, 2023
09c24de
verbose
dubzzz Sep 29, 2023
0df88ae
better source
dubzzz Sep 29, 2023
b24b45e
switch to nvm
dubzzz Sep 29, 2023
acb396c
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
178dc24
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
ea7def8
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
d64e98e
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
332b5eb
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
f71fdfa
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
3a14f8b
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
2c7a59b
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
9abdf9e
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
3afd7d7
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
b112eda
Update .github/workflows/build-status.yml
dubzzz Sep 29, 2023
fdcb187
Merge branch 'main' into legacy-node-check
dubzzz Sep 30, 2023
3c46954
Update .github/workflows/build-status.yml
dubzzz Sep 30, 2023
bdfdd2d
play
dubzzz Sep 30, 2023
02732a1
try
dubzzz Sep 30, 2023
880152d
try
dubzzz Sep 30, 2023
3abd9ff
rertry
dubzzz Sep 30, 2023
4b1ae81
retry
dubzzz Sep 30, 2023
6daa0f0
yet another
dubzzz Sep 30, 2023
5f00e43
yet another
dubzzz Sep 30, 2023
8199f3f
retry
dubzzz Sep 30, 2023
5d3e8d2
retry
dubzzz Sep 30, 2023
055ffad
retry
dubzzz Sep 30, 2023
ead605c
try again?
dubzzz Sep 30, 2023
bc8cfb2
Merge remote-tracking branch 'origin/main' into legacy-node-check
dubzzz Sep 30, 2023
ccc14ec
retry
dubzzz Sep 30, 2023
8db18fc
try
dubzzz Sep 30, 2023
f8bb5c7
retry
dubzzz Sep 30, 2023
9a6d848
with source
dubzzz Sep 30, 2023
87bee8a
retry
dubzzz Sep 30, 2023
45c3cc3
try
dubzzz Sep 30, 2023
a643d87
try
dubzzz Sep 30, 2023
eecaf4e
nvs
dubzzz Sep 30, 2023
2c92ffd
no source
dubzzz Sep 30, 2023
88591d9
add
dubzzz Sep 30, 2023
ef2abbd
retry
dubzzz Sep 30, 2023
713186e
new try
dubzzz Sep 30, 2023
7d8a648
retry
dubzzz Sep 30, 2023
d2251c3
add sanity check
dubzzz Sep 30, 2023
57c3659
improve check
dubzzz Sep 30, 2023
bbf4c84
others
dubzzz Sep 30, 2023
f76ebe9
simplify
dubzzz Sep 30, 2023
6dc0d97
more
dubzzz Sep 30, 2023
e032fd7
retry
dubzzz Sep 30, 2023
7d1c60b
retry
dubzzz Sep 30, 2023
9dd75e0
bash
dubzzz Sep 30, 2023
240efee
retry
dubzzz Sep 30, 2023
4c35809
retry again
dubzzz Sep 30, 2023
92d9008
no exec bug
dubzzz Sep 30, 2023
3dd6c91
fix nvs?
dubzzz Sep 30, 2023
a2796b3
fix
dubzzz Sep 30, 2023
6fe4b4c
more
dubzzz Sep 30, 2023
00aef0d
retry
dubzzz Sep 30, 2023
72b72c0
facepalm
dubzzz Sep 30, 2023
3d585b1
fix all?
dubzzz Sep 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 5 additions & 43 deletions .github/workflows/build-status.yml
Expand Up @@ -332,6 +332,11 @@ jobs:
run: yarn workspaces foreach -pvi --no-private exec "git restore -s@ -SW -- test-bundle || true"
- name: Check bundles
run: yarn workspaces foreach -pvi --no-private run test-bundle
- name: Check legacy bundles
run: |
git clone --branch v1.7.1 --depth 1 https://github.com/jasongin/nvs ~/.nvs
. ~/.nvs/nvs.sh install
dubzzz marked this conversation as resolved.
Show resolved Hide resolved
yarn workspaces foreach -pvi --no-private run test-legacy-bundle
- name: Check publication lint
run: yarn publint:all
test_types:
Expand Down Expand Up @@ -396,48 +401,6 @@ jobs:
cd packages/test-types
sed -i 's/fc-expect-error-require-exactOptionalPropertyTypes/ts-expect-error/g' *.ts
yarn dlx -p typescript@${{matrix.ts-version}} tsc --exactOptionalPropertyTypes
test_node_8:
name: 'Test legacy Node'
needs:
- warmup_yarn_cache
- production_packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Using Node v18.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
cache: 'yarn'
check-latest: true
- name: Install dependencies
run: yarn install --immutable
- name: Download production packages
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: bundles
path: packages/
- name: Unpack production packages
run: yarn unpack:all
- name: Alter internals to behave as if published
run: yarn workspaces foreach -pRvi --from '@fast-check/test-minimal-support' --no-private exec yarn node $(yarn bin packaged) --keep-node-modules
- name: Using Node v8.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '8.x'
check-latest: true
- name: Test packages/test-minimal-support/
run: |
cd packages/test-minimal-support
node --version
node main.js
# Re-install node 16, for clean-up related logic as it does not work with node 8
# The caching logic of actions/setup-node calls yarn to know the version
- name: Using Node v18.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
check-latest: true

# Publication jobs
publish_documentation:
Expand Down Expand Up @@ -465,7 +428,6 @@ jobs:
- typecheck
- test
- test_bundle
- test_node_8
- test_types
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .yarn/versions/dcfe3085.yml
@@ -0,0 +1,2 @@
declined:
- fast-check
3 changes: 2 additions & 1 deletion packages/fast-check/package.json
Expand Up @@ -39,7 +39,8 @@
"e2e:watch": "jest --config jest.e2e.config.cjs --watch",
"e2e:debug": "node --inspect ../../node_modules/jest/bin/jest.js --config jest.e2e.config.cjs --watch --runInBand",
"update:examples": "cross-env UPDATE_CODE_SNIPPETS=true jest --config jest.examples.config.cjs",
"test-bundle": "node test-bundle/run.cjs && node test-bundle/run.mjs",
"test-bundle": "node test-bundle/run.cjs && node test-bundle/run.mjs && node test-bundle/run-advanced.cjs",
"test-legacy-bundle": "nvs add 8 && $(nvs which 8) test-bundle/run.cjs && $(nvs which 8) test-bundle/run-advanced.cjs",
"docs": "api-extractor run --local && rm docs/fast-check.api.json && typedoc --out docs src/fast-check-default.ts && node postbuild/main.cjs",
"docs-ci": "cross-env EXPECT_GITHUB_SHA=true yarn docs",
"docs:serve": "yarn dlx serve docs/"
Expand Down
@@ -1,5 +1,7 @@
// @ts-check
// eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef
var assert = require('assert');
// eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef
var fc = require('fast-check');

function testArbitrary(arb) {
Expand All @@ -12,9 +14,10 @@ function testArbitrary(arb) {

// should be able to detect failing runs and report them correctly
// should be able to shrink with no crash
var runId = 0;
var successfulAssert = true;
try {
var runId = 0;
runId = 0;
fc.assert(
fc.property(arb, function () {
return runId++ % 3 === 0;
Expand All @@ -28,7 +31,7 @@ function testArbitrary(arb) {
assert.ok(successfulAssert, 'Assert failed with an unexpected failure');

// should be able to replay a failing case
var runId = 0;
runId = 0;
var details = fc.check(
fc.property(arb, function () {
return runId++ % 3 === 0;
Expand All @@ -53,6 +56,7 @@ function testArbitrary(arb) {
assert.notEqual(stats.length, 0);
}

console.log('Starting ' + __filename + '...');
testArbitrary(fc.nat());
testArbitrary(fc.subarray([1, 42, 360]));
testArbitrary(fc.array(fc.nat()));
Expand Down
2 changes: 2 additions & 0 deletions packages/fast-check/test-bundle/run.cjs
@@ -1,2 +1,4 @@
const fc = require('fast-check');

console.log('Starting ' + __filename + '...');
console.log(fc.sample(fc.nat(), { seed: 42, numRuns: 5 }));
3 changes: 3 additions & 0 deletions packages/fast-check/test-bundle/run.mjs
@@ -1,2 +1,5 @@
import fc from 'fast-check';
import * as url from 'url';

console.log('Starting ' + url.fileURLToPath(import.meta.url) + '...');
console.log(fc.sample(fc.nat(), { seed: 42, numRuns: 5 }));
11 changes: 0 additions & 11 deletions packages/test-minimal-support/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions packages/test-minimal-support/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions yarn.lock
Expand Up @@ -2832,14 +2832,6 @@ __metadata:
languageName: unknown
linkType: soft

"@fast-check/test-minimal-support@workspace:packages/test-minimal-support":
version: 0.0.0-use.local
resolution: "@fast-check/test-minimal-support@workspace:packages/test-minimal-support"
dependencies:
fast-check: "workspace:*"
languageName: unknown
linkType: soft

"@fast-check/test-types@workspace:packages/test-types":
version: 0.0.0-use.local
resolution: "@fast-check/test-types@workspace:packages/test-types"
Expand Down