@ -250,19 +250,11 @@ func TestInitProviders_pluginCache(t *testing.T) {
// convert the slashes if building for windows.
// convert the slashes if building for windows.
p := filepath . FromSlash ( "./cache" )
p := filepath . FromSlash ( "./cache" )
cmd . Env = append ( cmd . Env , "TF_PLUGIN_CACHE_DIR=" + p )
cmd . Env = append ( cmd . Env , "TF_PLUGIN_CACHE_DIR=" + p )
cmd . Stdin = nil
cmd . Stderr = & bytes . Buffer { }
err = cmd . Run ( )
err = cmd . Run ( )
if err != nil {
if err != nil {
t . Errorf ( "unexpected error: %s" , err )
t . Errorf ( "unexpected error: %s" , err )
}
}
stderr := cmd . Stderr . ( * bytes . Buffer ) . String ( )
if stderr != "" {
t . Errorf ( "unexpected stderr output:\n%s\n" , stderr )
}
path := filepath . FromSlash ( fmt . Sprintf ( ".terraform/providers/registry.terraform.io/hashicorp/template/2.1.0/%s_%s/terraform-provider-template_v2.1.0_x4" , runtime . GOOS , runtime . GOARCH ) )
path := filepath . FromSlash ( fmt . Sprintf ( ".terraform/providers/registry.terraform.io/hashicorp/template/2.1.0/%s_%s/terraform-provider-template_v2.1.0_x4" , runtime . GOOS , runtime . GOARCH ) )
content , err := tf . ReadFile ( path )
content , err := tf . ReadFile ( path )
if err != nil {
if err != nil {
@ -375,13 +367,13 @@ func TestInitProviderWarnings(t *testing.T) {
tf := e2e . NewBinary ( terraformBin , fixturePath )
tf := e2e . NewBinary ( terraformBin , fixturePath )
defer tf . Close ( )
defer tf . Close ( )
stdout, _ , err := tf . Run ( "init" )
_, stderr , err := tf . Run ( "init" )
if err == nil {
if err == nil {
t . Fatal ( "expected error, got success" )
t . Fatal ( "expected error, got success" )
}
}
if ! strings . Contains ( std out , "This provider is archived and no longer needed. The terraform_remote_state\ndata source is built into the latest Terraform release." ) {
if ! strings . Contains ( std err , "This provider is archived and no longer needed. The terraform_remote_state\ndata source is built into the latest Terraform release." ) {
t . Errorf ( "expected warning message is missing from output:\n%s" , std out )
t . Errorf ( "expected warning message is missing from output:\n%s" , std err )
}
}
}
}