diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2a912b5664..a7102bef96e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,8 @@ Thanks for your interest in contributing to Lodestar. It's people like you that ## Tests +To run tests: + - :test_tube: Run `lerna run test:unit` for unit tests. - :test_tube: Run `lerna run test:e2e` for end-to-end tests. - :test_tube: Run `lerna run test:spec` for spec tests. @@ -23,6 +25,13 @@ Thanks for your interest in contributing to Lodestar. It's people like you that - :test_tube: Run `yarn check-types` to check TypeScript types. - :test_tube: Run `yarn lint` to run the linter (ESLint). +Contributing to tests: + +- Test must not depend on external live resources, such that running tests for a commit must be deterministic: + - Do not pull data from external APIs like execution JSON RPC (instead run a local node). + - Do not pull unpinned versions from dockerhub (use deterministic tag) or Github (checkout commit not branch). + - Carefully design tests that depend on timing sensitive events like p2p network e2e tests. Consider that Github runners are significantly less powerful than your development environment. + ### Debugging Spec Tests - To fix errors always focus on passing all minimal tests first without running mainnet tests.