Merge pull request #2679 from ethereum/ci-in-forks

[CI] Run CI tests in parallel by forks
This commit is contained in:
Danny Ryan 2021-10-19 14:30:58 -06:00 committed by GitHub
commit 65d56dc9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 5 deletions

View File

@ -90,7 +90,7 @@ jobs:
name: Install pyspec requirements
command: make install_test
- save_pyspec_cached_venv
test:
test-phase0:
docker:
- image: circleci/python:3.8
working_directory: ~/specs-repo
@ -100,7 +100,33 @@ jobs:
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest
command: make citest fork=phase0
- store_test_results:
path: tests/core/pyspec/test-reports
test-altair:
docker:
- image: circleci/python:3.8
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=altair
- store_test_results:
path: tests/core/pyspec/test-reports
test-merge:
docker:
- image: circleci/python:3.8
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=merge
- store_test_results:
path: tests/core/pyspec/test-reports
table_of_contents:
@ -208,14 +234,20 @@ workflows:
- install_pyspec_test:
requires:
- checkout_specs
- test:
- test-phase0:
requires:
- install_pyspec_test
- test-altair:
requires:
- install_pyspec_test
- test-merge:
requires:
- install_pyspec_test
- table_of_contents
- codespell
- lint:
requires:
- test
- install_pyspec_test
# NOTE: Since phase 0 has been launched, we disabled the deposit contract tests.
# - install_deposit_contract_web3_tester:
# requires:

View File

@ -105,8 +105,15 @@ find_test: pyspec
python3 -m pytest -k=$(K) --disable-bls --cov=eth2spec.phase0.minimal --cov=eth2spec.altair.minimal --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec
citest: pyspec
mkdir -p tests/core/pyspec/test-reports/eth2spec; . venv/bin/activate; cd $(PY_SPEC_DIR); \
mkdir -p tests/core/pyspec/test-reports/eth2spec;
ifdef fork
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n 4 --bls-type=milagro --fork=$(fork) --junitxml=eth2spec/test_results.xml eth2spec
else
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n 4 --bls-type=milagro --junitxml=eth2spec/test_results.xml eth2spec
endif
open_cov:
((open "$(COV_INDEX_FILE)" || xdg-open "$(COV_INDEX_FILE)") &> /dev/null) &