Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
with:
terraform_version: 1.6.0
# Must satisfy `required_version = ">= 1.10.0"` declared by every
# terraform/environments/*/main.tf -- pinning below 1.10 makes
# `terraform init`/`validate` abort with "Unsupported Terraform
# Core version". Matches the pin in pre-commit.yml so both
# workflows resolve to the same binary.
terraform_version: 1.10.5

- name: Terraform Format Check
run: terraform fmt -check -recursive terraform/
Expand Down Expand Up @@ -390,14 +395,14 @@ jobs:

- name: Run E2E tests with docker-compose
run: |
docker-compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
env:
COMPOSE_INTERACTIVE_NO_CLI: 1

- name: Cleanup
if: always()
run: |
docker-compose -f docker-compose.test.yml down -v
docker compose -f docker-compose.test.yml down -v

# Assert that the Azure custom-role actions list is identical in the TF module
# and the ARM onboarding template. Fast (shell + jq only), so it always runs.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ cost-estimate:
# Docker Compose E2E tests
docker-compose-test:
@echo "Running E2E tests with docker-compose..."
docker-compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
docker-compose -f docker-compose.test.yml down -v
docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
docker compose -f docker-compose.test.yml down -v
Comment on lines +232 to +233

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Ensure teardown always runs even when tests fail.

Line 232 can legitimately return non-zero (because of --exit-code-from test-runner), which prevents Line 233 from running in make. That leaves test containers/volumes behind on failing runs.

Suggested fix
 docker-compose-test:
 	`@echo` "Running E2E tests with docker-compose..."
-	docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
-	docker compose -f docker-compose.test.yml down -v
+	`@set` -e; \
+	rc=0; \
+	docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner || rc=$$?; \
+	docker compose -f docker-compose.test.yml down -v; \
+	exit $$rc
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner
docker compose -f docker-compose.test.yml down -v
`@set` -e; \
rc=0; \
docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from test-runner || rc=$$?; \
docker compose -f docker-compose.test.yml down -v; \
exit $$rc
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 232 - 233, Replace the two separate Makefile command
lines so teardown always runs: run the test-up command (docker compose -f
docker-compose.test.yml up --abort-on-container-exit --exit-code-from
test-runner) in the same shell, capture its exit code, then always run the
teardown (docker compose -f docker-compose.test.yml down -v) and finally exit
with the captured code; i.e., group them so the up command's exit code is saved
(e.g., rc=$$?), teardown runs unconditionally, and the recipe returns the saved
rc.


# Install development dependencies
install-dev-tools:
Expand Down
Loading