openova/.github/workflows/test-bootstrap-kit.yaml
hatiyildiz 3dced3fdda test: bootstrap-kit Flux Kustomization integration test (#145)
Closes the Group L "integration test — provisioner backend bootstrap-kit
installer — all 11 phases install in sequence on a kind cluster" ticket.

Per the ticket note, the bootstrap installer is now Flux-driven from
clusters/<sovereign-fqdn>/ — NOT the bespoke Go-based installer that was
reverted in commit e668637. The test verifies that Flux reconciles the
right Kustomizations rather than that Go code helm-installs anything.

Two layers of validation:

1. Static manifest layer (runs on every push, cheap)
   - All 11 platform/<x>/blueprint.yaml + chart/Chart.yaml exist
   - Each blueprint.yaml satisfies catalyst.openova.io/v1alpha1 schema
     (apiVersion/kind/metadata.name/spec.version/card.title/card.summary)
   - Chart.yaml name matches "bp-<x>" and version matches blueprint.yaml
     spec.version
   - clusters/_template/ YAMLs parse after SOVEREIGN_FQDN_PLACEHOLDER
     substitution (when the template tree is on the branch — Group J/M
     ticket lands the per-Sovereign template)
   - The dependency order matches the canonical 11-phase sequence from
     SOVEREIGN-PROVISIONING.md §3 (cilium → cert-manager → flux →
     crossplane → sealed-secrets → spire → nats-jetstream → openbao →
     keycloak → gitea → bp-catalyst-platform)

2. Kind-cluster layer (runs on main pushes, gated on
   BOOTSTRAP_KIT_KIND_TEST=1)
   - Brings up kubernetes-in-docker
   - Installs Flux CRDs + source/kustomize controllers
   - Registers a GitRepository pointing at this monorepo
   - Synthesizes the 11 bootstrap-kit Kustomizations and applies them
   - Asserts the API server accepts all 11 (manifests are valid, schema
     satisfied) — this is the test's narrow scope per the ticket

The test deliberately does NOT wait for the kit to fully install upstream
charts or reach steady-state reconciliation. That belongs to #141 (real
Hetzner E2E with cloud credentials and outbound network), not a kind
cluster test in CI.

Files:
  - tests/e2e/bootstrap-kit/main_test.go (Go test, 11 subtests + 4 main)
  - tests/e2e/bootstrap-kit/go.mod (separate module — keeps test deps
    isolated from the production Go modules)
  - .github/workflows/test-bootstrap-kit.yaml (kind-action + flux2/action)

Refs #145

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 13:58:18 +02:00

85 lines
2.7 KiB
YAML

name: Test — Bootstrap Kit (kind cluster + Flux)
# Closes #145 — integration test that the 11-component bootstrap kit's
# Flux Kustomizations are well-formed and accepted by a real K8s API
# server. Spins up a kind cluster, installs Flux, and asserts that all
# 11 Kustomizations get registered. Does NOT wait for full reconciliation
# (chart pulls + cloud creds belong to #141 Hetzner E2E).
on:
push:
paths:
- 'tests/e2e/bootstrap-kit/**'
- 'platform/**/blueprint.yaml'
- 'platform/**/chart/**'
- 'clusters/**'
- '.github/workflows/test-bootstrap-kit.yaml'
branches: [main]
pull_request:
paths:
- 'tests/e2e/bootstrap-kit/**'
- 'platform/**/blueprint.yaml'
- 'platform/**/chart/**'
- 'clusters/**'
- '.github/workflows/test-bootstrap-kit.yaml'
workflow_dispatch:
jobs:
manifest-validation:
# Static-only validation: blueprint.yaml + chart Chart.yaml + clusters/_template
# parsing + dependency order check. Runs on every push.
runs-on: ubuntu-latest
defaults:
run:
working-directory: tests/e2e/bootstrap-kit
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: tests/e2e/bootstrap-kit/go.sum
- name: Run static validation
run: go test -v -count=1
kind-reconciliation:
# Kind-cluster reconciliation: brings up kubernetes-in-docker, installs
# Flux, and verifies the API server accepts our 11 bootstrap-kit
# Kustomizations. Runs only on main to keep PRs fast — the ticket calls
# for "all 11 phases install in sequence on a kind cluster (CI)" so this
# is the long-form gate.
runs-on: ubuntu-latest
needs: manifest-validation
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
defaults:
run:
working-directory: tests/e2e/bootstrap-kit
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: tests/e2e/bootstrap-kit/go.sum
- name: Set up kind
uses: helm/kind-action@v1
with:
cluster_name: bootstrap-kit-test
version: v0.25.0
node_image: kindest/node:v1.30.6
- name: Install Flux CLI
uses: fluxcd/flux2/action@main
- name: Run kind-reconciliation test
env:
BOOTSTRAP_KIT_KIND_TEST: '1'
BOOTSTRAP_KIT_GIT_URL: https://github.com/${{ github.repository }}
run: go test -v -count=1 -run TestBootstrapKit_KindReconciliation -timeout 10m