Skip to content

Slice 4: Create unified validation pipeline (Jenkinsfile.validation) #592

@floatingman

Description

@floatingman

Parent PRD

#585

What to build

Create a single Declarative Pipeline Jenkinsfile.validation that replaces four nearly-identical test runners:

  • validation/Jenkinsfile (189 lines)
  • validation/Jenkinsfile.e2e (124 lines)
  • validation/Jenkinsfile.harvester (158 lines)
  • validation/Jenkinsfile.vsphere (148 lines)

These four files share the exact same stage flow (Checkout → Configure and Build → Run Validation Tests → Test Report), the same Dockerfile.tofu_and_validation build, the same configure.sh/build.sh usage, and the same Docker cleanup. They differ only in: node label (harvester-vpn-1, vsphere-vpn-1, or unallocated), credential set size, and minor reporterScript differences.

Parameterized pipeline flow:

  1. Resolve pipeline parameters via resolvePipelineParams
  2. Checkout tests repo
  3. Configure and build Docker image (Dockerfile.tofu_and_validation)
  4. Run validation tests via gotestsum inside Docker container
  5. Archive JUnit test results
  6. Optionally report to Qase
  7. Docker cleanup via standardDockerCleanup

Parameters:

  • NODE_LABEL (choice: '', 'harvester-vpn-1', 'vsphere-vpn-1') — controls agent allocation and credential loading
  • TEST_PACKAGE — Go test package to run
  • CONFIG — Test configuration file
  • BRANCH, REPO, TIMEOUT — standard parameters resolved by resolvePipelineParams
  • QASE_TEST_RUN_ID (string, optional) — enables Qase reporting when set

Credential loading: The standardCredentialLoader function loads the correct credential set based on NODE_LABEL:

  • Empty (unallocated): Full credential set (AWS, Azure, GCP, vSphere, registry, TLS)
  • harvester-vpn-1: Harvester-specific credentials
  • vsphere-vpn-1: vSphere-specific credentials

This pipeline uses simpleTestPipeline shared function from #589 for the standard stage flow.

Acceptance criteria

  • Jenkinsfile.validation created in Declarative Pipeline syntax
  • NODE_LABEL='' produces identical results to validation/Jenkinsfile
  • NODE_LABEL='harvester-vpn-1' produces identical results to validation/Jenkinsfile.harvester
  • NODE_LABEL='vsphere-vpn-1' produces identical results to validation/Jenkinsfile.vsphere
  • Default parameters match validation/Jenkinsfile.e2e behavior
  • standardCredentialLoader loads correct credentials for each node label
  • resolvePipelineParams handles job name parsing
  • standardDockerCleanup runs in post { always } block
  • simpleTestPipeline shared function is consumed for stage flow
  • Original 4 Jenkinsfiles remain untouched (parallel coexistence)
  • Pipeline passes at least 1 successful run per NODE_LABEL variant

Blocked by

User stories addressed

  • User story 14 (4 nearly-identical test runners as single parameterized pipeline)
  • User story 15 (NODE_LABEL parameter for target environment selection)
  • User story 16 (credential sets loaded based on target environment)
  • User story 17 (resolvePipelineParams function)
  • User story 18 (standardDockerCleanup function)
  • User story 21 (Declarative Pipeline syntax)
  • User story 22 (parallel coexistence)
  • User story 24 (harmonized parameters)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestteam/pit-crewslack notifier for pit crew

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions