@@ -22,7 +22,7 @@ import (
22
22
"github.com/coder/coder/provisionersdk/proto"
23
23
)
24
24
25
- func testProvisioner (t * testing.T ) (context.Context , proto.DRPCProvisionerClient ) {
25
+ func setupProvisioner (t * testing.T ) (context.Context , proto.DRPCProvisionerClient ) {
26
26
client , server := provisionersdk .TransportPipe ()
27
27
ctx , cancelFunc := context .WithCancel (context .Background ())
28
28
t .Cleanup (func () {
@@ -46,7 +46,7 @@ func testProvisioner(t *testing.T) (context.Context, proto.DRPCProvisionerClient
46
46
func TestProvision (t * testing.T ) {
47
47
t .Parallel ()
48
48
49
- ctx , api := testProvisioner (t )
49
+ ctx , api := setupProvisioner (t )
50
50
51
51
for _ , testCase := range []struct {
52
52
Name string
@@ -298,9 +298,11 @@ func TestProvision(t *testing.T) {
298
298
299
299
// nolint:paralleltest
300
300
func TestProvision_ExtraEnv (t * testing.T ) {
301
+ secretValue := "oinae3uinxase"
301
302
t .Setenv ("TF_LOG" , "INFO" )
303
+ t .Setenv ("TF_SUPERSECRET" , secretValue )
302
304
303
- ctx , api := testProvisioner (t )
305
+ ctx , api := setupProvisioner (t )
304
306
305
307
directory := t .TempDir ()
306
308
path := filepath .Join (directory , "main.tf" )
@@ -330,6 +332,7 @@ func TestProvision_ExtraEnv(t *testing.T) {
330
332
if strings .Contains (log .Output , "TF_LOG" ) {
331
333
found = true
332
334
}
335
+ require .NotContains (t , log .Output , secretValue )
333
336
}
334
337
if c := msg .GetComplete (); c != nil {
335
338
require .Empty (t , c .Error )
0 commit comments