Files
lighthouse/testing/ef_tests/Makefile
Justin Traglia 2f807e21be Add support for nightly tests (#7538)
This PR adds the ability to download [nightly reference tests from the consensus-specs repo](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml). This will be used by spec maintainers to ensure that there are no unexpected test failures prior to new releases. Also, we will keep track of test compliance with [this website](https://jtraglia.github.io/nyx/); eventually this will be integrated into Hive.


  * A new script (`download_test_vectors.sh`) is added to handle downloads.
* The logic for downloading GitHub artifacts is a bit complex.
* Rename the variables which store test versions:
* `TESTS_TAG` to `CONSENSUS_SPECS_TEST_VERSION`.
* `BLS_TEST_TAG` to `BLS_TEST_VERSION`, for consistency.
* Delete tarballs after extracting them.
* I see no need to keep these; they just use extra disk.
* Consolidate `clean` rules into a single rule.
* Do `clean` prior to downloading/extracting tests.
* Remove `CURL` variable with GitHub token; don't need it for downloading releases.
* Do `mkdir -p` when creating directories.
* Probably more small stuff...
2025-06-05 12:28:06 +00:00

34 lines
1018 B
Makefile

# To download/extract nightly tests, run:
# CONSENSUS_SPECS_TEST_VERSION=nightly make
CONSENSUS_SPECS_TEST_VERSION ?= v1.6.0-alpha.0
REPO_NAME := consensus-spec-tests
OUTPUT_DIR := ./$(REPO_NAME)
BLS_TEST_REPO_NAME := bls12-381-tests
BLS_TEST_VERSION := v0.1.1
BLS_TEST = bls_tests_yaml
BLS_OUTPUT_DIR := $(OUTPUT_DIR)/$(BLS_TEST_REPO_NAME)
BLS_BASE_URL := https://github.com/ethereum/$(BLS_TEST_REPO_NAME)/releases/download/$(BLS_TEST_VERSION)
.PHONY: all clean
all: clean $(OUTPUT_DIR) $(BLS_OUTPUT_DIR)
clean:
rm -rf *.tar.gz $(OUTPUT_DIR) $(BLS_OUTPUT_DIR)
$(OUTPUT_DIR):
mkdir -p $(OUTPUT_DIR)
./download_test_vectors.sh $(CONSENSUS_SPECS_TEST_VERSION)
for test_tarball in *.tar.gz; do \
tar -xzf $$test_tarball -C $(OUTPUT_DIR); \
rm -f $$test_tarball; \
done
$(BLS_OUTPUT_DIR):
mkdir -p $(BLS_OUTPUT_DIR)
curl --progress-bar --location --remote-name --show-error --retry 3 --retry-all-errors --fail \
$(BLS_BASE_URL)/$(BLS_TEST).tar.gz
tar -xzf *.tar.gz -C $(BLS_OUTPUT_DIR)
rm -f *.tar.gz