You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to run the terratests from Github Actions. It works fine locally, but I am getting below error when running from the GH Runner.
To Reproduce
name: Integration Testson:
workflow_dispatchjobs:
go-tests:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5with:
go-version: '1.21'
- name: Create moduleworking-directory: terraform/testsrun: go mod init "mymod"
- name: Go mod tidyworking-directory: terraform/testsrun: go mod tidy
- name: Run Testsworking-directory: terraform/testsrun: go test -v -tags mytag
Expected behavior
Tests are getting executed.
Terminal output
[Integration Tests/go-tests] ⭐ Run Main Run Tests
[Integration Tests/go-tests] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=terraform/tests
| === RUN MyTestFunction1
| === PAUSE MyTestFunction1
| === CONT MyTestFunction1
| myTest.go:31: mLaAA7
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:91: tofu [init -upgrade=false]
| MyTestFunction1 2024-01-25T16:54:12Z logger.go:66: Running command tofu with args [init -upgrade=false]
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| apply.go:15:
| Error Trace: /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/apply.go:15
| /mnt/c/repos/terraform-templates-deployment/terraform/tests/myTest.go:48
| Error: Received unexpected error:
| FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| Test: MyTestFunction1
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:91: tofu [destroy -auto-approve -input=false -var postfix=mlaaa7 -lock=false]
| MyTestFunction1 2024-01-25T16:54:12Z logger.go:66: Running command tofu with args [destroy -auto-approve -input=false -var postfix=mlaaa7 -lock=false]
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| destroy.go:11:
| Error Trace: /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/destroy.go:11
| /opt/hostedtoolcache/go/1.21.6/x64/src/runtime/panic.go:523
| /opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:999
| /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/apply.go:15
| /mnt/c/repos/terraform-templates-deployment/terraform/tests/myTest.go:48
| Error: Received unexpected error:
| FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| Test: MyTestFunction1
| --- FAIL: MyTestFunction1 (0.00s)
| FAIL
| exit status 1
Versions
Terratest version: v0.46.11
Environment details : ubuntu 22.04
** Additional **
I don't want to use tofu. I want to use terraform. I tried installing terraform as part of the Github action workflow, but that does not make any difference.
The text was updated successfully, but these errors were encountered:
I had a similar problem locally. The same error occurred when the terraform command was not available in the terminal. Make sure that Terraform is installed and the path to the directory where the Terraform executable exists is in the PATH environment variable. Try running the terraform --version command via the workflow to verify it
Describe the bug
I am trying to run the terratests from Github Actions. It works fine locally, but I am getting below error when running from the GH Runner.
To Reproduce
Expected behavior
Tests are getting executed.
Terminal output
[Integration Tests/go-tests] ⭐ Run Main Run Tests
[Integration Tests/go-tests] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=terraform/tests
| === RUN MyTestFunction1
| === PAUSE MyTestFunction1
| === CONT MyTestFunction1
| myTest.go:31: mLaAA7
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:91: tofu [init -upgrade=false]
| MyTestFunction1 2024-01-25T16:54:12Z logger.go:66: Running command tofu with args [init -upgrade=false]
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| apply.go:15:
| Error Trace: /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/apply.go:15
| /mnt/c/repos/terraform-templates-deployment/terraform/tests/myTest.go:48
| Error: Received unexpected error:
| FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| Test: MyTestFunction1
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:91: tofu [destroy -auto-approve -input=false -var postfix=mlaaa7 -lock=false]
| MyTestFunction1 2024-01-25T16:54:12Z logger.go:66: Running command tofu with args [destroy -auto-approve -input=false -var postfix=mlaaa7 -lock=false]
| MyTestFunction1 2024-01-25T16:54:12Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| destroy.go:11:
| Error Trace: /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/destroy.go:11
| /opt/hostedtoolcache/go/1.21.6/x64/src/runtime/panic.go:523
| /opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:999
| /root/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/apply.go:15
| /mnt/c/repos/terraform-templates-deployment/terraform/tests/myTest.go:48
| Error: Received unexpected error:
| FatalError{Underlying: error while running command: exec: "tofu": executable file not found in $PATH; }
| Test: MyTestFunction1
| --- FAIL: MyTestFunction1 (0.00s)
| FAIL
| exit status 1
Versions
** Additional **
I don't want to use tofu. I want to use terraform. I tried installing terraform as part of the Github action workflow, but that does not make any difference.
The text was updated successfully, but these errors were encountered: