diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index d74ab6a..d728c27 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -7,18 +7,33 @@ jobs: name: Run Terratest Success Unit Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.21.6 - name: Run Terratest Unit Tests run: | - cd test + go mod download go test -v -run TestECRValidateSuccess -timeout 30m ./... + working-directory: test + ecr-failure-validation: name: Run Terratest Failure Unit Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.21.6 - name: Run Terratest Unit Tests run: | - cd test + go mod download go test -v -run TestECRValidateFailure -timeout 30m ./... + working-directory: test diff --git a/test/unit-test/failure/ecr.tf b/test/unit-test/failure/ecr.tf index acab8d1..8c7b504 100644 --- a/test/unit-test/failure/ecr.tf +++ b/test/unit-test/failure/ecr.tf @@ -1,5 +1,5 @@ module "ecr_fail" { - source = "github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials?ref=tf-validation" + source = "../../.." # Repository configuration repo_name = var.namespace diff --git a/test/unit-test/failure/variables.tf b/test/unit-test/failure/variables.tf index b491f13..2fd330e 100644 --- a/test/unit-test/failure/variables.tf +++ b/test/unit-test/failure/variables.tf @@ -34,4 +34,4 @@ variable "github_owner" { variable "github_token" { description = "Required by the GitHub terraform provider" default = "" -} +} \ No newline at end of file diff --git a/test/unit-test/success/ecr.tf b/test/unit-test/success/ecr.tf index 86f8706..39719d3 100644 --- a/test/unit-test/success/ecr.tf +++ b/test/unit-test/success/ecr.tf @@ -1,5 +1,5 @@ module "ecr_pass" { - source = "github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials?ref=tf-validation" + source = "../../.." # Repository configuration repo_name = var.namespace diff --git a/test/unit-test/success/variables.tf b/test/unit-test/success/variables.tf index b491f13..2fd330e 100644 --- a/test/unit-test/success/variables.tf +++ b/test/unit-test/success/variables.tf @@ -34,4 +34,4 @@ variable "github_owner" { variable "github_token" { description = "Required by the GitHub terraform provider" default = "" -} +} \ No newline at end of file