File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed
Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 2020 run : make build
2121 - name : Unit Test
2222 run : make test
23+
24+ e2e :
25+ runs-on : ubuntu-latest
26+ permissions : {}
27+ steps :
28+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
29+ - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
30+ with :
31+ go-version-file : ' go.mod'
32+ - name : E2E Test
33+ run : make test-e2e
34+
2335 lint :
2436 runs-on : ubuntu-latest
2537 permissions : {}
Original file line number Diff line number Diff line change @@ -25,11 +25,15 @@ clean: ## Clean binary folders
2525
2626.PHONY : test
2727test : # # Run unit tests
28- go test ./... -timeout=30s -parallel=4 -race
28+ go test ./internal/ ... -timeout=30s -parallel=4 -race
2929
3030.PHONY : test-update
3131test-update : # # Run unit tests and update the golden files
32- go test ./... -timeout=30s -parallel=4 -race -update
32+ go test ./internal/... -timeout=30s -parallel=4 -race -update
33+
34+ .PHONY : test-e2e
35+ test-e2e : local # # Run E2E tests (running the plugin binary)
36+ ATLAS_CLI_EXTRA_PLUGIN_DIRECTORY=" ${PWD} /bin-plugin" go test ./test/... -timeout=30s -parallel=4 -race
3337
3438.PHONY : local
3539local : clean build # # Allow to run the plugin locally
Original file line number Diff line number Diff line change 1+ package e2e
2+
3+ import "os/exec"
4+
5+ func RunPlugin (args ... string ) (string , error ) {
6+ cmd := exec .Command ("atlas" , args ... )
7+ resp , err := cmd .CombinedOutput ()
8+ return string (resp ), err
9+ }
Original file line number Diff line number Diff line change 1+ package e2e_test
2+
3+ import (
4+ "testing"
5+
6+ "github.com/mongodb-labs/atlas-cli-plugin-terraform/test/e2e"
7+ "github.com/stretchr/testify/require"
8+ )
9+
10+ func TestPlugin (t * testing.T ) {
11+ t .Run ("Execute TF command" , func (t * testing.T ) {
12+ resp , err := e2e .RunPlugin ("tf" )
13+ require .NoError (t , err , resp )
14+ })
15+ }
You can’t perform that action at this time.
0 commit comments