Skip to content

Instantly share code, notes, and snippets.

@adiasg
Last active May 4, 2023 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adiasg/a1a1b32fc670cc159a03a10287a9b228 to your computer and use it in GitHub Desktop.
Save adiasg/a1a1b32fc670cc159a03a10287a9b228 to your computer and use it in GitHub Desktop.
Scripts to automate pre-commit tests & CI checks on eth2.0-specs
FROM node:latest
WORKDIR /specs
RUN npm install -g doctoc
CMD ["make", "check_toc"]
#!/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
#!/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