-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
test: migrate spec-test-utils and spec tests to vitest #6222
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
888e898
Migrate spec-test-utils and spec tests to vitest
nazarhussain 8ee5096
Fix build check
nazarhussain 8898434
Fix export path
nazarhussain 2b4a853
Add config file
nazarhussain 8103c63
Fix spec tests
nazarhussain 9c28afd
Fix the duplicate package script
nazarhussain 8282848
Fix spec tests
nazarhussain 346f171
Fix lint errors
nazarhussain 862279f
Update the spec tests runner tasks
nazarhussain 46cc4a3
Fix the import for a spec test
nazarhussain 84b174c
Fix the import for a spec test
nazarhussain c59ab70
Fix spec tests
nazarhussain b9d6e04
Update the task runner
nazarhussain 07868f4
Run spec test in fork not threads
nazarhussain 33c3541
Fix the config file path
nazarhussain e71cfb7
Fix validator spec tests
nazarhussain 6690e77
Fix e2e tests
nazarhussain a20bcf2
Make the validator spec tests run in parallel
nazarhussain a7764f0
Update the spec test runner options
nazarhussain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/beacon-node/test/spec/presets/epoch_processing.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/beacon-node/test/spec/presets/light_client/single_merkle_proof.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/beacon-node/test/spec/presets/light_client/update_ranking.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {defineConfig, mergeConfig} from "vitest/config"; | ||
import vitestConfig from "../../vitest.base.config"; | ||
|
||
export default mergeConfig( | ||
vitestConfig, | ||
defineConfig({ | ||
test: { | ||
globalSetup: ["./test/globalSetup.ts"], | ||
testTimeout: 60_000, | ||
passWithNoTests: true, | ||
pool: "threads", | ||
poolOptions: { | ||
threads: { | ||
isolate: false, | ||
}, | ||
}, | ||
}, | ||
}) | ||
); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,24 @@ | |
}, | ||
"homepage": "https://github.com/ChainSafe/lodestar#readme", | ||
"type": "module", | ||
"exports": "./lib/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./lib/index.js" | ||
}, | ||
"./downloadTests": { | ||
"import": "./lib/downloadTests.js" | ||
} | ||
}, | ||
"types": "lib/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"lib/*", | ||
"lib/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"lib/**/*.js", | ||
"lib/**/*.js.map", | ||
|
@@ -26,12 +42,13 @@ | |
"build": "tsc -p tsconfig.build.json", | ||
"build:release": "yarn clean && yarn build", | ||
"build:watch": "yarn run build --watch", | ||
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"", | ||
"check-build": "node -e \"(async function() { await import('./lib/downloadTests.js') })()\"", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned in above comment. |
||
"check-types": "tsc", | ||
"lint": "eslint --color --ext .ts src/ test/", | ||
"lint:fix": "yarn run lint --fix", | ||
"pretest": "yarn run check-types", | ||
"test:e2e": "mocha 'test/e2e/**/*.test.ts'", | ||
"test:unit": "vitest --run --passWithNoTests --dir test/unit/ --coverage", | ||
"test:e2e": "vitest --run --dir test/e2e/", | ||
"check-readme": "typescript-docs-verifier" | ||
}, | ||
"repository": { | ||
|
@@ -48,8 +65,7 @@ | |
"@lodestar/utils": "^1.13.0", | ||
"async-retry": "^1.3.3", | ||
"axios": "^1.3.4", | ||
"chai": "^4.3.7", | ||
"mocha": "^10.2.0", | ||
"vitest": "^1.0.2", | ||
"rimraf": "^4.4.1", | ||
"snappyjs": "^0.7.0", | ||
"tar": "^6.1.13" | ||
|
@@ -59,7 +75,6 @@ | |
"@types/tar": "^6.1.4" | ||
}, | ||
"peerDependencies": { | ||
"chai": "^4.3.7", | ||
"mocha": "^10.2.0" | ||
"vitest": "^1.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export async function setup(): Promise<void> {} | ||
export async function teardown(): Promise<void> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {defineConfig, mergeConfig} from "vitest/config"; | ||
import vitestConfig from "../../vitest.base.config"; | ||
|
||
export default mergeConfig( | ||
vitestConfig, | ||
defineConfig({ | ||
test: { | ||
globalSetup: ["./test/globalSetup.ts"], | ||
}, | ||
}) | ||
); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handler is throwing an error
block not found
, which isunhandled rejection
even in previous implementation but never been caught by mocha.