โ† Back to Visual Guide Index

๐Ÿงช E2E Tests for infra-deployments PRs

Exactly What Tests Run and What They Validate

โš ๏ธ Critical Understanding

When you open a PR in infra-deployments, the E2E tests DO NOT run all 7 test suites blindly! Instead, intelligent rules detect which components changed and run only the relevant tests plus a baseline "konflux" suite. This is crucial for fast CI and avoiding unnecessary test execution.

๐Ÿ“š Related Guides: Complete Testing Flow | Understanding Overlays

๐Ÿšช Entry Point: How Tests Start

1
PR Opens in infra-deployments
GitHub webhook notifies OpenShift CI (Prow) of the new PR
2
Prow Provisions Cluster
OpenShift 4.17 cluster is created on AWS (5-10 minutes)
3
Bootstrap Script Runs
infra-deployments/hack/bootstrap-cluster.sh installs Konflux with YOUR PR changes (15-20 min)
4
E2E Test Script Executes
openshift/release calls redhat-appstudio-e2e-commands.sh
# From: openshift/release/.../redhat-appstudio-e2e-commands.sh # This is the EXACT script that runs! # 1. Clone e2e-tests repo git clone --branch main \ "https://${GITHUB_TOKEN}@github.com/konflux-ci/e2e-tests.git" . # 2. Prepare e2e branch (handles PR pairing if needed) make ci/prepare/e2e-branch # 3. Run the tests make ci/test/e2e # Which calls: ./mage -v ci:teste2e

๐Ÿง  Intelligent Test Selection (The Magic!)

๐ŸŽฏ Key Concept: Smart Rules Engine The e2e-tests repository has a built-in rules engine that analyzes which files changed in your infra-deployments PR and selects appropriate tests. This is NOT random - it's carefully designed!
# From: e2e-tests/magefiles/magefile.go func RunE2ETests() error { switch rctx.RepoName { case "infra-deployments": // Use special infra-deployments rules! return engine.MageEngine.RunRules(rctx, "tests", "infra-deployments") default: // For other repos, run default label filter labelFilter := "!upgrade-create && !upgrade-verify && !upgrade-cleanup && !release-pipelines" return runTests(labelFilter, "e2e-report.xml") } }

๐Ÿ“‹ The Rules (From Real Code!)

Rule 1: Integration Component Changed
IF: Files changed in components/integration/**/*
THEN run tests with label: integration-service + konflux
Rule 2: Build Service Component Changed
IF: Files changed in components/build-service/**/*
BUT NOT: build-pipeline-config.yaml
THEN run tests with label: build-service + konflux
Rule 3: Build Templates Changed
IF: components/build-service/base/build-pipeline-config/build-pipeline-config.yaml changed
THEN run tests with label: build-templates + konflux
Rule 4: Release Service Component Changed
IF: Files changed in components/release/**/*
THEN run tests with label: release-service + konflux
Rule 5: Multi-Platform Controller Changed
IF: Files changed in components/multi-platform-controller/**/*
THEN run tests with label: multi-platform + konflux
Rule 6: Enterprise Contract Changed
IF: Files changed in components/enterprise-contract/**/*
THEN run tests with label: ec + konflux
Rule 7: Image Controller Changed
IF: Files changed in components/image-controller/**/*
THEN run tests with label: image-controller + konflux
Rule 8: Pipeline Service Changed
IF: Files changed in components/pipeline-service/**/*
THEN run tests with label: pipeline-service + konflux
Default Rule: Other Changes
IF: Changes to files NOT matched by any specific component rule above
THEN run tests with label: konflux only (baseline tests)
# From: e2e-tests/magefiles/rulesengine/repos/infra_deployments.go var InfraDeploymentsDefaultRule = rulesengine.Rule{ Name: "Infra Deployments Default Test Execution", Description: "Run the Konflux-demo suite tests when an Infra-deployments PR includes changes to files outside of the specified components.", Condition: rulesengine.None{ // NOT any of the specific component rules }, Actions: []rulesengine.Action{ rulesengine.ActionFunc(ExecuteInfraDeploymentsDefaultTestAction) } } func ExecuteInfraDeploymentsDefaultTestAction(rctx *rulesengine.RuleCtx) error { rctx.LabelFilter = "konflux" // Only baseline tests! return ExecuteTestAction(rctx) }

๐Ÿท๏ธ What Each Test Label Means

๐Ÿ—๏ธ build-service

Tests in tests/build/

  • Build pipeline creation
  • Container image builds
  • Build service API
  • Pipeline configuration

๐Ÿ“‹ build-templates

Tests in tests/build/

  • Pipeline templates
  • Tekton task validation
  • Bundle references
  • Template parameters

๐Ÿ”— integration-service

Tests in tests/integration-service/

  • Snapshot creation
  • Integration test execution
  • Status reporting to PRs
  • GitLab integration

๐Ÿš€ release-service

Tests in tests/release/

  • Release plan creation
  • Quay.io pushes
  • GitHub releases
  • Release pipelines

๐Ÿ—๏ธ multi-platform

Tests in tests/build/

  • Multi-arch builds
  • ARM64 builds
  • ppc64le/s390x builds
  • Build coordination

๐Ÿ›ก๏ธ ec (Enterprise Contract)

Tests in tests/enterprise-contract/

  • Policy enforcement
  • SLSA attestations
  • Security validation
  • Compliance checks

๐Ÿ“ฆ image-controller

Tests in component-specific suite

  • Image repository setup
  • Image promotion
  • Registry operations
  • Image metadata

โš™๏ธ pipeline-service

Tests in component-specific suite

  • Tekton pipeline runs
  • Task execution
  • Pipeline results
  • Resource quotas

๐ŸŽฏ konflux (ALWAYS RUNS)

Tests in tests/konflux-demo/

  • Basic user workflows
  • Application creation
  • Component onboarding
  • End-to-end scenarios
๐ŸŽฏ The "konflux" Label is ALWAYS Included! No matter which component changed, the baseline "konflux" tests always run. This ensures basic functionality works even if you only changed a specific component. Think of it as a sanity check.

๐Ÿ“š Real-World Examples

Example 1: Renovate PR Updates build-service Image
# Files changed: - components/build-service/development/kustomization.yaml - components/build-service/staging/base/kustomization.yaml - components/build-service/production/base/kustomization.yaml # Rules engine detects: โœ“ InfraDeploymentsBuildServiceComponentChangeRule matches! # Tests that run: ginkgo --label-filter="build-service,konflux" ./tests/... # Test suites executed: โœ“ tests/build/ (build-service label) โœ“ tests/konflux-demo/ (konflux label) # Test suites SKIPPED: โœ— tests/integration-service/ โœ— tests/release/ โœ— tests/enterprise-contract/ โœ— tests/upgrade/ โœ— tests/load-tests/
Example 2: Manual PR Updates Monitoring Configuration
# Files changed: - components/monitoring/prometheus/servicemonitor.yaml - components/monitoring/grafana/dashboard.json # Rules engine detects: โœ“ NO specific component rules match! โœ“ InfraDeploymentsDefaultRule applies! # Tests that run: ginkgo --label-filter="konflux" ./tests/... # Test suites executed: โœ“ tests/konflux-demo/ (konflux label ONLY) # Why? Monitoring changes don't affect core functionality # so only baseline tests run!
Example 3: PR Updates Multiple Components
# Files changed: - components/build-service/base/deployment.yaml - components/integration/base/deployment.yaml - components/release/base/release-plan.yaml # Rules engine detects: โœ“ InfraDeploymentsBuildServiceComponentChangeRule matches! โœ“ InfraDeploymentsIntegrationComponentChangeRule matches! โœ“ InfraDeploymentsReleaseServiceComponentChangeRule matches! # Tests that run: ginkgo --label-filter="build-service,integration-service,release-service,konflux" ./tests/... # Test suites executed: โœ“ tests/build/ (build-service label) โœ“ tests/integration-service/ (integration-service label) โœ“ tests/release/ (release-service label) โœ“ tests/konflux-demo/ (konflux label) # This runs MORE tests because MORE components changed!

๐Ÿ“‚ Key File Locations

๐Ÿš€ CI Entry Point

The script that starts everything:

openshift/release/.../redhat-appstudio-e2e-commands.sh

๐Ÿง  Rules Engine Code

Where test selection rules are defined:

konflux-ci/e2e-tests/magefiles/rulesengine/repos/
infra_deployments.go โ† Main rules! build_service.go integration_service.go release_service.go

๐Ÿงช Test Suite Directories

Located in konflux-ci/e2e-tests/tests/:

build/
build-service, templates
integration-service/
integration tests
release/
release-service
enterprise-contract/
EC policy tests
konflux-demo/
ALWAYS RUNS
upgrade/
Not for infra PRs
View Rules Engine Code โ†’ View CI Scripts โ†’

๐Ÿ“‹ Summary: What You Need to Remember

The Complete Flow

1
CI clones e2e-tests repo
Gets the test code with built-in rules engine
2
Mage analyzes your PR
Looks at which files changed in infra-deployments
3
Rules engine selects tests
Matches changed files to test labels
4
Ginkgo runs selected tests
Executes only relevant test suites + konflux baseline
5
Results reported to GitHub
โœ… or โŒ status posted to your PR
๐ŸŽฏ Key Takeaways:
  • โœ… Tests are SMART - they only run what's relevant
  • โœ… "konflux" baseline tests ALWAYS run
  • โœ… Component-specific tests run only if that component changed
  • โœ… This saves time - typical run is 30-45 min, not 2+ hours
  • โœ… Rules are defined in e2e-tests repo, not infra-deployments