Split kind tests into component-owned probes
This commit is contained in:
parent
b3c0f6d58a
commit
691ad92e30
1 changed files with 4269 additions and 3108 deletions
55
tests/kind/fixture/lifecycle.sh
Normal file
55
tests/kind/fixture/lifecycle.sh
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
cleanup_lane_state() {
|
||||
local lane="$1"
|
||||
local coordination="$2"
|
||||
local target="$4"
|
||||
local status=0
|
||||
if fixture_has_family durable; then
|
||||
cleanup_lane_durable_store "$lane" || status=1
|
||||
fi
|
||||
if fixture_has_family coordination; then
|
||||
cleanup_lane_coordination_store "$coordination" "$lane" || status=1
|
||||
fi
|
||||
if fixture_has_family target; then
|
||||
cleanup_lane_target_store "$target" "nuthatch-lane-$lane" || status=1
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
cleanup_lane_resources() {
|
||||
local job="$1"
|
||||
local profile="$2"
|
||||
kube --namespace "$FIXTURE_NAMESPACE" delete \
|
||||
"job/$job" \
|
||||
"configmap/$profile" \
|
||||
"configmap/$profile-file" \
|
||||
"secret/nuthatch-oidc-automation-${profile##*-}" \
|
||||
--ignore-not-found >/dev/null || return
|
||||
rm -f \
|
||||
"$RUNTIME/$profile.env" \
|
||||
"$RUNTIME/$profile.env.oidc-secret" \
|
||||
"$RUNTIME/$job.yaml"
|
||||
}
|
||||
|
||||
run_job_matrix() {
|
||||
local base_job="$1"
|
||||
local manifest="$2"
|
||||
local image="$3"
|
||||
shift 3
|
||||
local lane
|
||||
local coordination
|
||||
local oidc
|
||||
local target
|
||||
local profile
|
||||
local job
|
||||
select_fixture_families "$@" || return
|
||||
while IFS=$'\t' read -r lane coordination oidc target; do
|
||||
profile="$(write_lane_profile "$lane" "$coordination" "$oidc" "$target")" || return
|
||||
job="$base_job-$lane"
|
||||
render_lane_job "$job" "$manifest" "$image" "$profile" || return
|
||||
printf 'Running lane %s: coordination=%s oidc=%s target=%s\n' \
|
||||
"$lane" "$coordination" "$oidc" "$target"
|
||||
run_job_manifest "$job" "$RUNTIME/$job.yaml" || return
|
||||
cleanup_lane_state "$lane" "$coordination" "$oidc" "$target" || return
|
||||
cleanup_lane_resources "$job" "$profile" || return
|
||||
done < <(expand_fixture_matrix "$@")
|
||||
}
|
||||
Loading…
Reference in a new issue