From 919f821885fab461185e7a0b3376dbf7e7ab5393 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Wed, 12 Mar 2025 18:03:31 +0200 Subject: [PATCH] Enable splitting our large tests into groups --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 17a35d3..a7ebded 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ MYPY_ARGS := --ignore-missing-imports \ --warn-unreachable \ --warn-unused-ignores \ --exclude $(LARGE_TEST_REPO_DIR)/*.py +TEST_GROUP_COUNT ?= 1 +TEST_GROUP ?= 1 +TEST_GROUP_RANDOM_SEED ?= 999999999 .PHONY: lint lint: ## Check the code for linting, formatting, and typing issues with ruff and mypy @@ -41,10 +44,18 @@ test-large-init: test-large-requirements git submodule update $(LARGE_TEST_REPO_DIR) cd $(LARGE_TEST_REPO_DIR) && $(MAKE) clone-docs -TEST_LARGE_RESULTS:=$(LARGE_TEST_REPO_DIR)/results/junit/commit_$(GIT_DESC).junit.xml +TEST_LARGE_RESULTS:=$(LARGE_TEST_REPO_DIR)/results/junit/commit_$(GIT_DESC)_$(TEST_GROUP).junit.xml .PHONY: test-large test-large: test-large-init ## Run large test set - python -m pytest --tb=no tests/test_large_set.py::TestLargeSet -v $(JUNIT_FLAGS) --junitxml=$(TEST_LARGE_RESULTS) + python -m pytest \ + --tb=no \ + --test-group-count=$(TEST_GROUP_COUNT) \ + --test-group=$(TEST_GROUP) \ + --test-group-random-seed=$(TEST_GROUP_RANDOM_SEED) \ + --junitxml=$(TEST_LARGE_RESULTS) \ + $(JUNIT_FLAGS) \ + -v \ + tests/test_large_set.py::TestLargeSet python $(TEST_LARGE_RESULTS)/report.py $(TEST_LARGE_RESULTS) Dockerfile: Dockerfile.env Dockerfile.in