Skip to content

refactor(e2e): Extract shared Make infrastructure into e2e.common.mk#3136

Open
LeelaChacha wants to merge 7 commits intokyma-project:mainfrom
LeelaChacha:main
Open

refactor(e2e): Extract shared Make infrastructure into e2e.common.mk#3136
LeelaChacha wants to merge 7 commits intokyma-project:mainfrom
LeelaChacha:main

Conversation

@LeelaChacha
Copy link
Contributor

The E2E test Makefiles for mandatory-module and mandatory-module-metrics each duplicated ~180 lines of boilerplate: Go/shell setup, tool version variables, install targets (ginkgo-install, kustomize-install, etc.), cluster lifecycle
targets (create-clusters, deploy-klm, teardown), and a log-tool-versions helper.

This PR extracts all shared infrastructure into a single included file and introduces a thin wrapper script for per-version module template setup.

Changes:

  • tests/e2e/e2e.common.mk (new) — single source of truth for shell config (.ONESHELL, bash, pipefail), Go/FIPS setup, directory variables, tool version variables, all install targets, cluster lifecycle targets, and log-tool-versions. Also, tool-install targets now skip re-installation if the binary already exists.
  • tests/e2e/mandatory_module_test.mk — reduced from ~225 lines to ~47. Now only contains test-specific targets: klm-patch, module-setup, test-run, clean-test-artifacts, test. Module template setup is delegated to the new deploy_moduletemplate_e2e.sh script instead of being inlined.
  • tests/e2e/mandatory_modules_metrics_test.mk — reduced from ~204 lines to ~38 lines. Same structure as mandatory_module_test.mk. test-run prerequisites trimmed to log-tool-versions only; kubeconfig exports are inlined in the recipe body consistent with the other test file.
  • scripts/tests/deploy_moduletemplate_e2e.sh (new) — wraps the per-version boilerplate (set image tag in kustomization, make build-manifests, rename Deployment, delegate to deploy_moduletemplate.sh) behind a named-flag interface replacing ~25 lines of inline Make recipe per call site.

@LeelaChacha LeelaChacha requested a review from a team as a code owner March 18, 2026 14:21
@github-actions
Copy link
Contributor

⚠️ Pipeline-related file changes detected! Please review if related updates (e.g. manifest generation or workflow adjustments) are required.

@LeelaChacha LeelaChacha requested a review from Copilot March 18, 2026 14:21
@LeelaChacha LeelaChacha changed the title refactor(e2e): extract shared Make infrastructure into e2e.common.mk refactor(e2e): Extract shared Make infrastructure into e2e.common.mk Mar 18, 2026
@LeelaChacha LeelaChacha enabled auto-merge (squash) March 18, 2026 14:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the E2E test Make infrastructure by extracting shared boilerplate (tooling, cluster lifecycle, logging) into a common include file and introducing a wrapper script to standardize per-version ModuleTemplate preparation/deployment.

Changes:

  • Added tests/e2e/e2e.common.mk to centralize shared E2E Make targets and variables (tools, clusters, logging).
  • Simplified mandatory_module_test.mk and mandatory_modules_metrics_test.mk to mostly test-specific orchestration using the shared include.
  • Added scripts/tests/deploy_moduletemplate_e2e.sh to encapsulate repeated ModuleTemplate prep/deploy steps behind flags.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/e2e/e2e.common.mk New shared Make include for tool install, cluster lifecycle, and helper targets.
tests/e2e/mandatory_module_test.mk Refactored to include common Make logic and use the new wrapper script for module template setup.
tests/e2e/mandatory_modules_metrics_test.mk Refactored similarly to use the common Make logic and wrapper script.
tests/e2e/e2e_test_template.mk New template Makefile intended for creating future E2E Makefiles using the new structure.
scripts/tests/deploy_moduletemplate_e2e.sh New wrapper script for per-version module template preparation and delegation to deploy_moduletemplate.sh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the E2E test Make infrastructure by extracting duplicated boilerplate from the mandatory-module Makefiles into a shared e2e.common.mk, and introduces a wrapper script to standardize per-version module template deployment.

Changes:

  • Add tests/e2e/e2e.common.mk to centralize shell/Go setup, tool versions/install, cluster lifecycle, and helpers.
  • Simplify mandatory_module_test.mk and mandatory_modules_metrics_test.mk to mostly test-specific targets and delegate template deployment to a new script.
  • Add scripts/tests/deploy_moduletemplate_e2e.sh to wrap repeated “set tag/build manifests/rename deployment/deploy template” steps behind flags.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/e2e/e2e.common.mk New shared Make infrastructure for E2E runs (tooling + cluster lifecycle + helpers).
tests/e2e/mandatory_module_test.mk Refactored to include common mk and delegate module template setup to script.
tests/e2e/mandatory_modules_metrics_test.mk Same refactor pattern as mandatory-module, with a slimmer test-run target.
tests/e2e/e2e_test_template.mk New template Makefile for future E2E suites based on the shared common mk.
scripts/tests/deploy_moduletemplate_e2e.sh New wrapper script for per-version module template preparation and deployment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@lindnerby lindnerby self-requested a review March 20, 2026 08:32
@lindnerby lindnerby self-assigned this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants