Skip to content

Commit 3282c5f

Browse files
committed
added preliminary bicep tests only
1 parent f88d1b4 commit 3282c5f

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/run-samples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name: Samples CI
66
# 1. Parallel Testing: Splits the sample suite into shards to reduce execution time.
77
# 2. Standardized Tooling: Uses a Makefile for environment setup and test orchestration.
88
# 3. Cloud Emulation: Configures the Azure CLI to target the LocalStack emulator.
9+
# 4. IaC Coverage: Tests bash scripts, Terraform deployments, and Bicep deployments.
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -122,6 +123,7 @@ jobs:
122123
123124
- name: Run Test Scripts
124125
# Executes the sharded test suite. Each shard runs a subset of samples in parallel.
126+
# This includes bash scripts, Terraform deployments, and Bicep deployments.
125127
run: make test SHARD=${{ matrix.shard }} SPLITS=${{ matrix.splits }}
126128
env:
127129
LOCALSTACK_AUTH_TOKEN: ${{ secrets.TEST_LOCALSTACK_AUTH_TOKEN }}

run-samples.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,19 @@ TERRAFORM_SAMPLES=(
9292
"samples/web-app-sql-database/python/terraform|bash deploy.sh"
9393
)
9494

95+
# 3b. Define Bicep Samples
96+
BICEP_SAMPLES=(
97+
"samples/function-app-managed-identity/python/bicep|bash deploy.sh"
98+
"samples/function-app-storage-http/dotnet/bicep|bash deploy.sh"
99+
"samples/web-app-cosmosdb-mongodb-api/python/bicep|bash deploy.sh"
100+
"samples/web-app-managed-identity/python/bicep|bash deploy.sh"
101+
"samples/web-app-sql-database/python/bicep|bash deploy.sh"
102+
)
103+
95104
# 4. Calculate Shard
96-
# Combine both script-based and Terraform samples into one array
97-
ALL_SAMPLES=("${SAMPLES[@]}" "${TERRAFORM_SAMPLES[@]}")
105+
# Combine script-based, Terraform, and Bicep samples into one array
106+
#ALL_SAMPLES=("${SAMPLES[@]}" "${TERRAFORM_SAMPLES[@]}" "${BICEP_SAMPLES[@]}")
107+
ALL_SAMPLES=("${BICEP_SAMPLES[@]}")
98108
TOTAL=${#ALL_SAMPLES[@]}
99109
SHARD=${1:-1}
100110
SPLITS=${2:-1}
@@ -107,7 +117,7 @@ if [ "$SHARD" -eq "$SPLITS" ]; then
107117
fi
108118

109119
echo "Running samples shard $SHARD of $SPLITS (index $START, count $COUNT)"
110-
echo "Total samples (scripts + terraform): $TOTAL"
120+
echo "Total samples (scripts + terraform + bicep): $TOTAL"
111121

112122
# 5. Run Samples
113123
for (( i=START; i<START+COUNT; i++ )); do
@@ -133,6 +143,13 @@ for (( i=START; i<START+COUNT; i++ )); do
133143
rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl tfplan || true
134144
fi
135145

146+
# Cleanup Bicep artifacts for bicep tests
147+
if [[ "$path" == *"/bicep" ]]; then
148+
echo "Cleaning up Bicep artifacts..."
149+
# Clean up zip files if any were created
150+
rm -f *.zip || true
151+
fi
152+
136153
popd > /dev/null
137154
echo "Completed: $path"
138155

0 commit comments

Comments
 (0)