github.com/kevinklinger/open_terraform@v1.3.6/noninternal/cloud/e2e/init_with_empty_tags_test.go (about)

     1  package main
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func Test_init_with_empty_tags(t *testing.T) {
     8  	t.Parallel()
     9  	skipIfMissingEnvVar(t)
    10  	skipWithoutRemoteTerraformVersion(t)
    11  
    12  	cases := testCases{
    13  		"terraform init with cloud block - no tagged workspaces exist yet": {
    14  			operations: []operationSets{
    15  				{
    16  					prep: func(t *testing.T, orgName, dir string) {
    17  						wsTag := "emptytag"
    18  						tfBlock := terraformConfigCloudBackendTags(orgName, wsTag)
    19  						writeMainTF(t, tfBlock, dir)
    20  					},
    21  					commands: []tfCommand{
    22  						{
    23  							command:           []string{"init"},
    24  							expectedCmdOutput: `There are no workspaces with the configured tags`,
    25  							userInput:         []string{"emptytag-prod"},
    26  							postInputOutput:   []string{`Terraform Cloud has been successfully initialized!`},
    27  						},
    28  					},
    29  				},
    30  			},
    31  		},
    32  	}
    33  
    34  	testRunner(t, cases, 1)
    35  }