Fix terraform test job - add init step before testing
Some checks failed
Code Quality & Security Scan / TFLint (push) Successful in 19s
Code Quality & Security Scan / Terraform Destroy (push) Has been skipped
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 36s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 36s
Code Quality & Security Scan / Terraform Tests (push) Failing after 40s
Code Quality & Security Scan / SonarQube Trigger (push) Has been skipped
Code Quality & Security Scan / Terraform Init (push) Has been skipped
Code Quality & Security Scan / Terraform Apply (push) Has been skipped

- Added terraform init -backend=false before running tests
- Tests don't require backend configuration
- Ensures providers are downloaded before test execution
- Fixes: terraform test failing due to missing providers
This commit is contained in:
Patrick de Ruiter 2025-11-09 09:54:19 +01:00
parent f06308bdfd
commit 89dabee068
Signed by: pderuiter
GPG Key ID: 5EBA7F21CF583321

View File

@ -79,6 +79,12 @@ jobs:
- name: Terraform Format Check - name: Terraform Format Check
run: terraform fmt -check -recursive run: terraform fmt -check -recursive
- name: Terraform Init (for testing)
run: terraform init -backend=false
env:
TF_VAR_role_id: "test-role-id"
TF_VAR_secret_id: "test-secret-id"
- name: Run Terraform Tests - name: Run Terraform Tests
run: terraform test -verbose run: terraform test -verbose
env: env: