0

I’ve been trying to use the Terratest shell module to execute bash commands, but I haven’t had much success. Documentation appears to be limited, and most references I found were via AI tools. Below is a snippet of the code I attempted.

package test

import (
    "testing"

    "github.com/gruntwork-io/terratest/modules/shell"
    "github.com/stretchr/testify/assert"
)

func TestShellCommand(t *testing.T) {
     // insert command
}

The main issue I encountered is that when running go test -v, the test consistently fails to import the shell module and reports an “unknown version 0.0.0” error.

Would like to seek advice on this. Thanks in advance.

2
  • 2
    Terratest is distributed as a normal Go module. You must initialize a module and let go resolve dependencies. The official quick start requires Go ≥ 1.21.1 and a proper go.mod (via go mod init + go mod tidy). Commented 2 days ago
  • 1
    Thanks. I try importing a specific version of Terraform and Shell module and it work now Commented 22 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.