2024-09-09 12:05:45 +00:00
|
|
|
// Copyright 2020-2024, Pulumi Corporation.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2023-01-30 19:30:30 +00:00
|
|
|
//go:build (python || 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 TestPythonAliases(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:49:49 +00:00
|
|
|
"adopt_component_child",
|
2023-05-01 23:50:00 +00:00
|
|
|
"extract_component_child",
|
2023-05-01 23:50:13 +00:00
|
|
|
"rename_component_child",
|
2023-05-01 23:50:35 +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("python", dir)
|
|
|
|
t.Run(d, func(t *testing.T) {
|
|
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
|
|
Dir: filepath.Join(d, "step1"),
|
|
|
|
Dependencies: []string{
|
|
|
|
filepath.Join("..", "..", "..", "sdk", "python", "env", "src"),
|
|
|
|
},
|
|
|
|
Quick: true,
|
|
|
|
EditDirs: []integration.EditDir{
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(d, "step2"),
|
|
|
|
Additive: true,
|
|
|
|
ExpectNoChanges: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2023-09-06 12:17:02 +00:00
|
|
|
|
|
|
|
// TestPythonAliasAfterFailedUpdate is a test for https://github.com/pulumi/pulumi/issues/13848.
|
|
|
|
func TestPythonAliasAfterFailedUpdate(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
|
|
|
|
d := filepath.Join("python", "alias_after_failed_update")
|
|
|
|
t.Run(d, func(t *testing.T) {
|
|
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
|
|
Dir: filepath.Join(d, "step1"),
|
|
|
|
Dependencies: []string{
|
|
|
|
filepath.Join("..", "..", "..", "sdk", "python", "env", "src"),
|
|
|
|
},
|
|
|
|
LocalProviders: []integration.LocalDependency{
|
|
|
|
{Package: "testprovider", Path: filepath.Join("..", "..", "testprovider")},
|
|
|
|
},
|
|
|
|
Quick: true,
|
|
|
|
EditDirs: []integration.EditDir{
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(d, "step2"),
|
|
|
|
Additive: true,
|
|
|
|
ExpectFailure: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Dir: filepath.Join(d, "step3"),
|
|
|
|
Additive: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|