Skip to content

Commit 0323961

Browse files
am1r021ScottyPoiScottyPoiCopilot
authored
VM test runner rewrite (#4088)
* Make runStateTests and helpers test-framework agnostic * Add simplified test runner * Add types for vm state test data * Move assert import into stateRunner.spec.ts * Use current test loader for vm state tests running vitest * Fix errors * Revert "Add types for vm state test data" This reverts commit 5c06661. * Update test retrieval and execution functions * Use vitest state runner for CI job * Use deepEqual * Exclude state test runner from unit testing * Add all parameters from legacy runner * Fix parameter typing * Catch errors and fail tests that throw errors * Add verifyTestAmountAllTests functionality to count and compare expected and actual test executions * Activate test count comparisons in CI runs * Fix test count comparison * Use env variables from process * Fix parameter passing in ci job * Calculate testcount for each testcase * Update packages/vm/test/tester/stateRunner.spec.ts * Remove duplicate tape assert * Switch state runner scripts to use new runner instead of legacy * Fix kzg and trustedSetup imports * Fix undefined check * Fix environment variables syntax * Remove error logging * fix linter error * update browser deps versions * use consistent spacing Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix test count incrementing Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use wrapper script to handle flags for test:state * Remove unused utility * Update DEVELOPER.md testing instructions * chore: migrate test util to vitest assert * chore: fix logComment calls in test util * test: add blockchain vitest runner spec * refactor: migrate blockchain runner to vitest * chore: add vitest wrapper for blockchain tests * chore: switch blockchain scripts to vitest * chore: note blockchain vitest wrapper in CI * docs: update vm blockchain testing to vitest * refactor: make state test runner vitest-only * chore: remove tape tester entrypoint * chore: drop tape dependencies and script * chore: update vm test scripts for vitest * docs: log vitest-only vm testers * Add log to show Fork being tested * fix type import * rename files * exclude blockchain runner from coverage test * exclude blockchain runner from browser * delete commented code * delete text --------- Co-authored-by: ScottyPoi <scott.simpson@ethereum.org> Co-authored-by: Scotty <66335769+ScottyPoi@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a8d3faa commit 0323961

19 files changed

+847
-771
lines changed

.github/workflows/vm-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
fail-on-cache-miss: true
117117

118118
- if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') == false
119-
run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
119+
run: VITE_FORK=${{ matrix.fork }} VITE_VERIFY_TEST_AMOUNT_ALL_TESTS=1 npx vitest run test/tester/state.spec.ts
120120

121121
- if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM')
122122
run: npm run test:buildIntegrity
@@ -237,13 +237,13 @@ jobs:
237237
fail-on-cache-miss: true
238238

239239

240-
- run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
240+
- run: VITE_FORK=${{ matrix.fork }} VITE_VERIFY_TEST_AMOUNT_ALL_TESTS=1 npx vitest run test/tester/state.spec.ts
241241

242242
vm-blockchain:
243243
runs-on: ubuntu-latest
244244
strategy:
245245
matrix:
246-
# Args to pass to the tester. Note that some have split the slow tests and only
246+
# Args to pass to the blockchain Vitest wrapper. Note that some have split the slow tests and only
247247
# run on forks where applicable (see PR #489 for numbers on these)
248248

249249
# Tests were split with --dir and --excludeDir to balance execution times below the 9min mark.
@@ -298,7 +298,7 @@ jobs:
298298
runs-on: ubuntu-latest
299299
strategy:
300300
matrix:
301-
# Args to pass to the tester.
301+
# Args to pass to the blockchain Vitest wrapper.
302302
args:
303303
[
304304
'--fork=Chainstart --verify-test-amount-alltests',

0 commit comments

Comments
 (0)