Skip to content

test(provisioner/terraform): clean up testdata structure #17074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update generate.sh
  • Loading branch information
mafredri committed Mar 24, 2025
commit a7216115ec2e2f8892c01e046041c89e70077d73
29 changes: 12 additions & 17 deletions provisioner/terraform/testdata/generate.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
cd "$(dirname "${BASH_SOURCE[0]}")/resources"

generate() {
local name="$1"
Expand Down Expand Up @@ -70,22 +70,17 @@ run() {
cd "$d"
name=$(basename "$(pwd)")

# This needs care to update correctly.
if [[ $name == "kubernetes-metadata" ]]; then
echo "== Skipping: $name"
return 0
fi

# This directory is used for a different purpose (quick workaround).
if [[ $name == "cleanup-stale-plugins" ]]; then
echo "== Skipping: $name"
return 0
fi

if [[ $name == "timings-aggregation" ]]; then
echo "== Skipping: $name"
return 0
fi
toskip=(
# This needs care to update correctly.
"kubernetes-metadata"
)
for skip in "${toskip[@]}"; do
if [[ $name == "$skip" ]]; then
echo "== Skipping: $name"
touch "$name.tfplan.json" "$name.tfplan.dot" "$name.tfstate.json" "$name.tfstate.dot"
return 0
fi
done

echo "== Generating test data for: $name"
if ! out="$(generate "$name" 2>&1)"; then
Expand Down
Loading