mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
* feat: run e2e tests in paralell + refactor test setup * fix: open handle issue * fix: sequencer finalized tag test issue + clean l2.spec tests * fix: refactor config structure * fix: genesis path issue * fix: pnpm lock file issue * fix: make each test run concurrently * fix: remove nested describes in tests * fix: refactor coordinator tests + add global L2 traffic generation * fix: change l2 genesis file for getting whale accounts + refactor utils function * fix: refactor coordinator restart util function * fix: remove conflation e2e tests * fix: add environment variable in e2e test ci workflowk * fix: coordinator restart test issue * fix: instanciate account manager only once per test file * fix: add restart option to zkbesu shomei and postman in docker compose file * fix: remove getAndIncreaseFeeData function and unsed utils functions * fix: increase messaging L2 to l1 timeout
End to end tests
Setup
Run pnpm install to setup typechain
Run make fresh-start-all from root directory to spin up local environment
Run tests
| ENV | Command | Description |
|---|---|---|
| Local | pnpm run test:e2e:local |
Uses already running docker environment and deployed smart contracts |
| DEV | pnpm run test:e2e:dev |
Uses DEV env, may need to update constants in constants.dev.ts |
| UAT | pnpm run test:e2e:uat |
Uses UAT env, may need to update constants in constants.uat.ts |
Remote workflows
Workflow options:
e2e-tests-with-ssh- Enable to runSetup upterm sessionstep, manually ssh into the github actions workflow using the steps output, can be used to debug containers.- The step will output a string used to connect to the workflow.
- Example:
ssh XTpun7OCRZMgaCZkiHqU:MWNlNmQ0OGEudm0udXB0ZXJtLmludGVybmFsOjIyMjI=@uptermd.upterm.dev - After connecting create a new file called
continuein the root directory:touch continue
e2e-tests-logs-dump- Enable to print logs after e2e tests have ran
Debugging test in vscode
Install the vscode-jest plugin and open zkevm-monorepo/e2e/ directory. Use the following config in zkevm-monorepo/e2e/.vscode/settings.json
{
"jest.autoRun": { "watch": false },
"jest.jestCommandLine": "pnpm run test:e2e:vscode --",
}
and the following config in zkevm-monorepo/e2e/.vscode/launch.json
{
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--config",
"./jest.vscode.config.js",
"--detectOpenHandles",
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
]
}
Now you should be able to run and debug individual tests from the Testing explorer tab.