-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add preview tests for replacements
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/pulumi/providertest/pulumitest" | ||
"github.com/pulumi/providertest/pulumitest/opttest" | ||
) | ||
|
||
// TestPreviewReplacements ensures that replacements for immutable fields are correctly previewed. | ||
func TestPreviewReplacements(t *testing.T) { | ||
test := pulumitest.NewPulumiTest(t, "testdata/preview-replacements", opttest.SkipInstall()) | ||
t.Logf("into %s", test.Source()) | ||
t.Cleanup(func() { | ||
test.Destroy() | ||
}) | ||
test.Preview() | ||
test.Up() | ||
|
||
// Preview should not fail when there is a replacement due to immutable fields. | ||
test.UpdateSource("testdata/preview-replacements", "step2") | ||
test.Preview() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: job-unreachable | ||
runtime: yaml | ||
resources: | ||
provider: | ||
type: pulumi:providers:kubernetes | ||
ns: | ||
type: kubernetes:core/v1:Namespace | ||
options: | ||
provider: ${provider} | ||
job: | ||
type: kubernetes:batch/v1:Job | ||
properties: | ||
metadata: | ||
name: test-job-previews | ||
namespace: ${ns.metadata.name} | ||
annotations: | ||
pulumi.com/skipAwait: "true" | ||
spec: | ||
template: | ||
metadata: | ||
name: test-job-unreachable | ||
spec: | ||
containers: | ||
- name: test-job-unreachable-container | ||
image: busybox | ||
command: | ||
- sh | ||
- -c | ||
- exit 0 | ||
restartPolicy: Never | ||
options: | ||
provider: ${provider} |
32 changes: 32 additions & 0 deletions
32
tests/sdk/java/testdata/preview-replacements/step2/Pulumi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: job-unreachable | ||
runtime: yaml | ||
resources: | ||
provider: | ||
type: pulumi:providers:kubernetes | ||
ns: | ||
type: kubernetes:core/v1:Namespace | ||
options: | ||
provider: ${provider} | ||
job: | ||
type: kubernetes:batch/v1:Job | ||
properties: | ||
metadata: | ||
name: test-job-previews | ||
namespace: ${ns.metadata.name} | ||
annotations: | ||
pulumi.com/skipAwait: "true" | ||
spec: | ||
template: | ||
metadata: | ||
name: test-job-unreachable | ||
spec: | ||
containers: | ||
- name: test-job-unreachable-container-step2 | ||
image: busybox | ||
command: | ||
- sh | ||
- -c | ||
- exit 0 | ||
restartPolicy: Never | ||
options: | ||
provider: ${provider} |