mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-04 22:21:46 +09:00
cozytest.sh runs each .bats as one invocation, exits on the first failing @test, and never invokes bats setup/teardown. Add a single EXIT-trap hook: on failure, snapshot the host AND every nested tenant cluster (tenantkubeconfig-*) with crust-gather into per-app dirs BEFORE cleanup — so each failure is independently inspectable (crust-gather serve) instead of one end-of-suite host-only dump; then ALWAYS run the file's cozy_cleanup() if defined. run-kubernetes.sh gains cozy_cleanup() (delete tenant clusters, wait for PVCs to free): a failed kubernetes test otherwise leaves tens of GiB of worker-VM PVCs in tenant-test, exhausting the shared tenant-quota and cascade-failing every storage-heavy app after it. The kubernetes .bats now source run-kubernetes.sh at file scope so the parent-shell trap can reach the hook. Ship pinned crust-gather 0.15.2 in the e2e-sandbox image; fold per-test snapshots into cozyreport.tgz. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
10 lines
368 B
Bash
10 lines
368 B
Bash
#!/usr/bin/env bats
|
|
|
|
# Sourced at file scope (see kubernetes-latest.bats) so cozytest.sh's parent
|
|
# shell gets run_kubernetes_test + the cozy_cleanup() hook for the EXIT trap.
|
|
. hack/e2e-apps/run-kubernetes.sh
|
|
|
|
@test "Create a tenant Kubernetes control plane with previous version" {
|
|
run_kubernetes_test 'keys | sort_by(.) | .[-2]' 'test-previous-version' '59992'
|
|
}
|