Last active
May 4, 2023 00:19
-
-
Save adiasg/a1a1b32fc670cc159a03a10287a9b228 to your computer and use it in GitHub Desktop.
Scripts to automate pre-commit tests & CI checks on eth2.0-specs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:latest | |
WORKDIR /specs | |
RUN npm install -g doctoc | |
CMD ["make", "check_toc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
# Install | |
python3 -m venv venv; . venv/bin/activate; pip3 install wheel | |
make pyspec | |
# Format | |
make check_toc | |
# To run doctoc with docker instead, use the below command: | |
# docker run -d -it --mount type=bind,source="$(pwd)",target=/specs check_toc | |
make lint | |
# Test | |
if [[ $1 == "test" ]] | |
then | |
make install_test | |
make test | |
. venv/bin/activate; cd ./tests/core/pyspec | |
python3 -m pytest -n 8 --disable-bls --cov=eth2spec.phase0.spec --cov=eth2spec.phase1.spec --cov=eth2spec.lightclient_patch.spec -cov-report="html:.htmlcov" --cov-branch eth2spec | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
if [[ $1 == "clean" ]] | |
then | |
make clean | |
fi | |
# Install | |
python3 -m venv venv; . venv/bin/activate; pip3 install wheel | |
pip install . | |
make pyspec | |
make install_test | |
# Test | |
. venv/bin/activate | |
cd ./tests/core/pyspec | |
# Run all tests | |
python -m pytest -n 4 --disable-bls eth2spec/test/ | |
# Alternatively, run specific tests only. Adjust the number of worker processess with the -n flag. | |
python -m pytest -n 1 --disable-bls eth2spec/test/phase0/fork_choice/test_on_block.py::test_basic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment