Parent PRD
#585
What to build
Create a Declarative Pipeline Jenkinsfile.airgap-rke2-tests that replaces Jenkinsfile.airgap.go-tests (405 lines) — the most comprehensive airgap pipeline that combines setup, test execution, and teardown into a single pipeline.
This pipeline consumes the shared functions added in #589. It uses make.runTarget() for cluster/registry/rancher operations (same as Slice 2) and shares the same infrastructure setup stages.
Full lifecycle flow:
- Standard dual-repo checkout via
airgap.standardCheckout
- Build
Dockerfile.airgap-go-tests image (kept separate from Dockerfile.infra to preserve build time)
- Setup infrastructure (same stages as Slice 2 setup flow, using shared functions):
- Tofu init → workspace create → apply
- Generate inventory from tofu outputs
- Configure Ansible variables via
airgap.configureAnsible
- Copy SSH keys to nodes via
ansible.runPlaybook
- Deploy RKE2 cluster via
make.runTarget(target: 'cluster')
- Configure private registry via
make.runTarget(target: 'registry') (conditional)
- Deploy Rancher via
make.runTarget(target: 'rancher') (unconditional in this pipeline)
- Generate
cattle-config.yaml — retrieve tofu outputs, run admin token generation playbook
- Run Go test suite via gotestsum with standardized flags and output format
- Optionally report results to Qase (controlled by
QASE_TEST_RUN_ID parameter)
- Teardown infrastructure if
DESTROY_AFTER_TESTS=true (via post { always })
- Teardown infrastructure on failure if
DESTROY_ON_FAILURE=true (via post { failure })
Key difference from Slice 2: This pipeline always deploys Rancher (no DEPLOY_RANCHER toggle), includes test execution stages, and has the DESTROY_AFTER_TESTS option. The teardown logic uses the same airgap.teardownInfrastructure function as the destroy pipeline.
Parameters (harmonized):
TEST_PACKAGE — Go test package to run
CONFIG — Test configuration file
DESTROY_ON_FAILURE (boolean, default: true)
DESTROY_AFTER_TESTS (boolean, default: true)
QASE_TEST_RUN_ID (string, optional) — enables Qase reporting when set
- Standard branch parameters, version parameters, TERRAFORM_CONFIG, ANSIBLE_VARIABLES
Acceptance criteria
Blocked by
User stories addressed
- User story 5 (tofu lifecycle via shared function)
- User story 7 (checkout via shared function)
- User story 9 (go-tests pipeline shares same checkout and infra functions)
- User story 10 (standardized gotestsum invocation)
- User story 11 (Qase reporting as optional stage)
- User story 12 (teardown logic shared with destroy pipeline)
- User story 13 (cattle-config generation as shared function)
- User story 21 (Declarative Pipeline syntax)
- User story 22 (parallel coexistence)
- User story 23 (simplified naming)
- User story 24 (harmonized parameters)
- User story 22-24 (Makefile integration for cluster/registry/rancher)
Parent PRD
#585
What to build
Create a Declarative Pipeline
Jenkinsfile.airgap-rke2-teststhat replacesJenkinsfile.airgap.go-tests(405 lines) — the most comprehensive airgap pipeline that combines setup, test execution, and teardown into a single pipeline.This pipeline consumes the shared functions added in #589. It uses
make.runTarget()for cluster/registry/rancher operations (same as Slice 2) and shares the same infrastructure setup stages.Full lifecycle flow:
airgap.standardCheckoutDockerfile.airgap-go-testsimage (kept separate fromDockerfile.infrato preserve build time)airgap.configureAnsibleansible.runPlaybookmake.runTarget(target: 'cluster')make.runTarget(target: 'registry')(conditional)make.runTarget(target: 'rancher')(unconditional in this pipeline)cattle-config.yaml— retrieve tofu outputs, run admin token generation playbookQASE_TEST_RUN_IDparameter)DESTROY_AFTER_TESTS=true(viapost { always })DESTROY_ON_FAILURE=true(viapost { failure })Key difference from Slice 2: This pipeline always deploys Rancher (no DEPLOY_RANCHER toggle), includes test execution stages, and has the DESTROY_AFTER_TESTS option. The teardown logic uses the same
airgap.teardownInfrastructurefunction as the destroy pipeline.Parameters (harmonized):
TEST_PACKAGE— Go test package to runCONFIG— Test configuration fileDESTROY_ON_FAILURE(boolean, default: true)DESTROY_AFTER_TESTS(boolean, default: true)QASE_TEST_RUN_ID(string, optional) — enables Qase reporting when setAcceptance criteria
Jenkinsfile.airgap-rke2-testscreated in Declarative Pipeline syntaxmake.runTarget(target: 'cluster')make.runTarget(target: 'rancher'))QASE_TEST_RUN_IDis setpost { failure }post { always }airgap.teardownInfrastructureas Slice 2 destroyJenkinsfile.airgap.go-testsremains untouched (parallel coexistence)Blocked by
Blocked by Slice 1: Add shared pipeline functions to qa-jenkins-library #589 (shared pipeline functions must be available)Slice 1: Add shared pipeline functions to qa-jenkins-library #589 is complete.User stories addressed