2020-09-02 16:11:15 +00:00
|
|
|
// Copyright 2016-2020, Pulumi Corporation. All rights reserved.
|
2023-01-30 19:30:30 +00:00
|
|
|
//go:build (go || all) && !xplatform_acceptance
|
2020-09-02 16:11:15 +00:00
|
|
|
|
|
|
|
package ints
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
2020-09-02 16:11:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestGoAliases(t *testing.T) {
|
2022-03-04 08:17:41 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
2023-03-03 16:36:39 +00:00
|
|
|
dirs := []string{
|
2021-07-12 18:38:51 +00:00
|
|
|
"rename",
|
|
|
|
"adopt_into_component",
|
|
|
|
"rename_component_and_child",
|
|
|
|
"retype_component",
|
|
|
|
"rename_component",
|
2022-06-29 18:50:26 +00:00
|
|
|
"retype_parents",
|
2023-05-01 22:32:05 +00:00
|
|
|
"adopt_component_child",
|
2023-05-01 22:32:18 +00:00
|
|
|
"extract_component_child",
|
2023-05-01 22:32:37 +00:00
|
|
|
"rename_component_child",
|
2023-05-01 22:32:46 +00:00
|
|
|
"retype_component_child",
|
2021-07-12 18:38:51 +00:00
|
|
|
}
|
|
|
|
|
2023-12-02 17:16:09 +00:00
|
|
|
//nolint:paralleltest // ProgramTest calls t.Parallel()
|
2020-09-02 16:11:15 +00:00
|
|
|
for _, dir := range dirs {
|
|
|
|
d := filepath.Join("go", dir)
|
|
|
|
t.Run(d, func(t *testing.T) {
|
|
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
|
|
Dir: filepath.Join(d, "step1"),
|
|
|
|
Dependencies: []string{
|
2022-12-09 19:46:22 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3=../../../sdk",
|
2020-09-02 16:11:15 +00:00
|
|
|
},
|
|
|
|
Quick: true,
|
|
|
|
EditDirs: []integration.EditDir{
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(d, "step2"),
|
|
|
|
ExpectNoChanges: true,
|
|
|
|
Additive: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2023-02-04 18:53:43 +00:00
|
|
|
|
2023-12-02 17:16:09 +00:00
|
|
|
//nolint:paralleltest // ProgramTest calls t.Parallel()
|
2023-02-04 18:53:43 +00:00
|
|
|
func TestRetypeRemoteComponentAndChild(t *testing.T) {
|
|
|
|
dir := filepath.Join("go", "retype_remote_component_and_child")
|
|
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
|
|
Dir: filepath.Join(dir, "step1"),
|
|
|
|
Dependencies: []string{
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3=../../../sdk",
|
|
|
|
},
|
|
|
|
Quick: true,
|
|
|
|
LocalProviders: []integration.LocalDependency{
|
|
|
|
{Package: "wibble", Path: filepath.Join(dir, "provider")},
|
|
|
|
},
|
|
|
|
EditDirs: []integration.EditDir{
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(dir, "step2"),
|
|
|
|
ExpectNoChanges: true,
|
|
|
|
Additive: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|