From 28efaea30e3d7d406963a8c9a88dbe0ed2f4aa20 Mon Sep 17 00:00:00 2001 From: Lion - dapplion <35266934+dapplion@users.noreply.github.com> Date: Mon, 8 May 2023 23:00:07 +0900 Subject: [PATCH] chore: add note in CONTRIBUTING about external test deps (#5471) * Add note in CONTRIBUTING about external test deps * Update CONTRIBUTING.md Co-authored-by: Nico Flaig --------- Co-authored-by: Nico Flaig --- CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2a912b56644..a7102bef96e6 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.