Skip to content

Replace --compilers and --procs with -p flag after Ginkgo v2.23.4 upgrade #194

@KevFan

Description

@KevFan

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

  • Upgrade Ginkgo to v2.23.4 or later (current installation uses version from go.mod)
  • Verify that -p flag behavior meets our testing requirements
  • Test integration tests with the new flag to ensure they still pass correctly

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions