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 (nodejs || 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
|
|
|
)
|
|
|
|
|
|
|
|
// TestNodejsAliases tests a case where a resource's name changes but it provides an `alias`
|
|
|
|
// pointing to the old URN to ensure the resource is preserved across the update.
|
|
|
|
func TestNodejsAliases(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 23:27:40 +00:00
|
|
|
"adopt_component_child",
|
2023-05-01 23:27:52 +00:00
|
|
|
"extract_component_child",
|
2023-05-01 23:28:25 +00:00
|
|
|
"rename_component_child",
|
2023-05-01 23:28:36 +00:00
|
|
|
"retype_component_child",
|
2021-07-12 18:38:51 +00:00
|
|
|
}
|
|
|
|
|
2020-09-02 16:11:15 +00:00
|
|
|
for _, dir := range dirs {
|
|
|
|
d := filepath.Join("nodejs", dir)
|
|
|
|
t.Run(d, func(t *testing.T) {
|
|
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
|
|
Dir: filepath.Join(d, "step1"),
|
|
|
|
Dependencies: []string{"@pulumi/pulumi"},
|
|
|
|
Quick: true,
|
|
|
|
EditDirs: []integration.EditDir{
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(d, "step2"),
|
|
|
|
Additive: true,
|
|
|
|
ExpectNoChanges: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|