github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/command/e2etest/remote_state_test.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package e2etest 5 6 import ( 7 "path/filepath" 8 "testing" 9 10 "github.com/terramate-io/tf/e2e" 11 ) 12 13 func TestTerraformProviderRead(t *testing.T) { 14 // Ensure the terraform provider can correctly read a remote state 15 16 t.Parallel() 17 fixturePath := filepath.Join("testdata", "terraform-provider") 18 tf := e2e.NewBinary(t, terraformBin, fixturePath) 19 20 //// INIT 21 _, stderr, err := tf.Run("init") 22 if err != nil { 23 t.Fatalf("unexpected init error: %s\nstderr:\n%s", err, stderr) 24 } 25 26 //// PLAN 27 _, stderr, err = tf.Run("plan") 28 if err != nil { 29 t.Fatalf("unexpected plan error: %s\nstderr:\n%s", err, stderr) 30 } 31 }