From 1abf7527a30c90ab617acaa866138de791501c6c Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 20 Aug 2025 17:51:56 -0700 Subject: [PATCH 1/2] Make: add "full-test" target to run NGINX test suite. We need this to ensure that 900031a does not happen again. To maintain a reasonable test execution time, the target runs parallel jobs on all available CPUs. --- Makefile | 6 +++++- build/compat-gnu.mk | 1 + build/compat-posix.mk | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e34dd1c..74dd2ce 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,11 @@ unittest: $(NGINX_BUILD_DIR)/Makefile ## Run unit-tests $(BUILD_ENV) $(NGX_CARGO) test test: $(TEST_PREREQ) ## Run the integration test suite - env $(TEST_ENV) prove -I $(NGINX_TESTS_DIR)/lib --state=save $(TESTS) ||\ + env $(TEST_ENV) prove -I $(NGINX_TESTS_DIR)/lib -v $(TESTS) + +full-test: $(TEST_PREREQ) ## Run the module and NGINX integration test suites + env $(TEST_ENV) prove -I $(NGINX_TESTS_DIR)/lib --state=save \ + -j $(TEST_JOBS) $(TESTS) $(NGINX_TESTS_DIR) ||\ env $(TEST_ENV) prove -I $(NGINX_TESTS_DIR)/lib --state=failed -v clean: ## Cleanup everything diff --git a/build/compat-gnu.mk b/build/compat-gnu.mk index 2364e0f..bdf27ab 100644 --- a/build/compat-gnu.mk +++ b/build/compat-gnu.mk @@ -1,4 +1,5 @@ HOST_TUPLE := $(shell $(NGX_CARGO) -vV | awk '/^host: / { print $$2; }') +TEST_JOBS := $(shell nproc 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1) # extension for Rust cdylib targets ifeq ($(shell uname), Darwin) diff --git a/build/compat-posix.mk b/build/compat-posix.mk index f3af3a6..4fec031 100644 --- a/build/compat-posix.mk +++ b/build/compat-posix.mk @@ -1,4 +1,5 @@ HOST_TUPLE != $(NGX_CARGO) -vV | awk '/^host: / { print $$2; }' +TEST_JOBS != nproc 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1 # bsd make compatibility CURDIR ?= $(.CURDIR) From d655dffc5e72bf5f8386a12b312064edaeb0ac96 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 21 Aug 2025 12:25:52 -0700 Subject: [PATCH 2/2] CI: run "full-test" in selected jobs. --- .github/workflows/ci.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b64432c..3564207 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,6 +60,13 @@ jobs: nginx-ref: stable-1.28 build: debug + env: + testTarget: >- + ${{ (matrix.nginx-ref == 'stable-1.28' && matrix.build == 'debug') + && 'full-test' + || 'test' + }} + runs-on: ${{ matrix.runner }}-latest steps: @@ -73,8 +80,6 @@ jobs: with: repository: 'nginx/nginx-tests' path: 'nginx/tests' - sparse-checkout: | - lib - uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b with: @@ -117,4 +122,4 @@ jobs: - name: run tests # always run if build succeeds if: ${{ !cancelled() && steps.build.outcome == 'success' }} - run: make BUILD=${{ matrix.build }} TEST_PREREQ= test + run: make BUILD=${{ matrix.build }} TEST_PREREQ= ${{ env.testTarget }}