Description
Currently, our integration tests in the Limitador Operator use separate --compilers and --procs flags to configure Ginkgo's parallelization. According to the Ginkgo v2.23.4 documentation, these flags can be replaced with a single -p flag for improved usability and automatic optimization.
Current Implementation
In the Makefile (lines 239-253), we currently use:
$(GINKGO) $(VERBOSE_FLAG) \
--coverpkg $(INTEGRATION_COVER_PKGS) \
--output-dir $(PROJECT_PATH)/coverage/integration \
--coverprofile cover.out \
--compilers=$(INTEGRATION_TEST_NUM_CORES) \
--procs=$(INTEGRATION_TEST_NUM_PROCESSES) \
--randomize-all \
--randomize-suites \
--fail-on-pending \
--keep-going \
--race \
--trace \
$(INTEGRATION_TEST_SUITE_PATHS)
With these variables defined:
INTEGRATION_TEST_NUM_CORES ?= 4
INTEGRATION_TEST_NUM_PROCESSES ?= 10
Proposed Change
Replace the above parallelization flags with:
$(GINKGO) $(VERBOSE_FLAG) \
--coverpkg $(INTEGRATION_COVER_PKGS) \
--output-dir $(PROJECT_PATH)/coverage/integration \
--coverprofile cover.out \
-p \
--randomize-all \
--randomize-suites \
--fail-on-pending \
--keep-going \
--race \
--trace \
$(INTEGRATION_TEST_SUITE_PATHS)
This will automatically configure both compilation parallelization and test execution parallelization based on the available system resources.
Files to Update
- Makefile - Update the
test-integration target to use -p instead of --compilers and --procs
Benefits
- Simplified configuration: Single flag instead of two separate flags with manual values
- Automatic optimization: Ginkgo automatically determines optimal parallelization based on available system resources
- Follows best practices: Aligns with Ginkgo's recommended CI configuration
- Reduced maintenance: No need for manual tuning of
INTEGRATION_TEST_NUM_CORES and INTEGRATION_TEST_NUM_PROCESSES values
- Better performance: Ginkgo's automatic parallelization typically performs better than manually configured values
Prerequisites
Optional Cleanup
Consider removing these variables if they're no longer needed after the change:
INTEGRATION_TEST_NUM_CORES ?= 4
INTEGRATION_TEST_NUM_PROCESSES ?= 10
Notes
- The current Ginkgo installation in the Makefile automatically picks up the version from go.mod, so upgrading Ginkgo should be done there first
- This change only affects the
test-integration target in the main Makefile
- The
-p flag will automatically scale based on the CI environment's available resources
Description
Currently, our integration tests in the Limitador Operator use separate
--compilersand--procsflags to configure Ginkgo's parallelization. According to the Ginkgo v2.23.4 documentation, these flags can be replaced with a single-pflag for improved usability and automatic optimization.Current Implementation
In the Makefile (lines 239-253), we currently use:
$(GINKGO) $(VERBOSE_FLAG) \ --coverpkg $(INTEGRATION_COVER_PKGS) \ --output-dir $(PROJECT_PATH)/coverage/integration \ --coverprofile cover.out \ --compilers=$(INTEGRATION_TEST_NUM_CORES) \ --procs=$(INTEGRATION_TEST_NUM_PROCESSES) \ --randomize-all \ --randomize-suites \ --fail-on-pending \ --keep-going \ --race \ --trace \ $(INTEGRATION_TEST_SUITE_PATHS)With these variables defined:
Proposed Change
Replace the above parallelization flags with:
$(GINKGO) $(VERBOSE_FLAG) \ --coverpkg $(INTEGRATION_COVER_PKGS) \ --output-dir $(PROJECT_PATH)/coverage/integration \ --coverprofile cover.out \ -p \ --randomize-all \ --randomize-suites \ --fail-on-pending \ --keep-going \ --race \ --trace \ $(INTEGRATION_TEST_SUITE_PATHS)This will automatically configure both compilation parallelization and test execution parallelization based on the available system resources.
Files to Update
test-integrationtarget to use-pinstead of--compilersand--procsBenefits
INTEGRATION_TEST_NUM_CORESandINTEGRATION_TEST_NUM_PROCESSESvaluesPrerequisites
-pflag behavior meets our testing requirementsOptional Cleanup
Consider removing these variables if they're no longer needed after the change:
Notes
test-integrationtarget in the main Makefile-pflag will automatically scale based on the CI environment's available resources