Skip to content

Commit

Permalink
Test duplicate outputs
Browse files Browse the repository at this point in the history
Regression test to cover #9411
  • Loading branch information
Frassle committed Jun 29, 2023
1 parent 5043e3d commit 04ce92c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/integration/integration_python_test.go
Expand Up @@ -1061,3 +1061,18 @@ func TestConstructProviderPropagationPython(t *testing.T) {
filepath.Join("..", "..", "sdk", "python", "env", "src"),
})
}

// Regression test for https://github.com/pulumi/pulumi/issues/9411
func TestDuplicateOutputPython(t *testing.T) {
integration.ProgramTest(t, &integration.ProgramTestOptions{
Dir: filepath.Join("python", "duplicate-output"),
Dependencies: []string{
filepath.Join("..", "..", "sdk", "python", "env", "src"),
},
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
expected := []interface{}{float64(1), float64(2)}
assert.Equal(t, expected, stack.Outputs["export1"])
assert.Equal(t, expected, stack.Outputs["export2"])
},
})
}
6 changes: 6 additions & 0 deletions tests/integration/python/duplicate-output/.gitignore
@@ -0,0 +1,6 @@
*.pyc
/.pulumi/
/dist/
/*.egg-info
venv/
lib/
3 changes: 3 additions & 0 deletions tests/integration/python/duplicate-output/Pulumi.yaml
@@ -0,0 +1,3 @@
name: pulumi-python-duplicate-output
description: A Python program that tests returning the same output twice.
runtime: python
8 changes: 8 additions & 0 deletions tests/integration/python/duplicate-output/__main__.py
@@ -0,0 +1,8 @@
# Copyright 2016-2023, Pulumi Corporation. All rights reserved.

import pulumi

a = pulumi.Output.from_input([1, 2])

pulumi.export("export1", a)
pulumi.export("export2", a)
1 change: 1 addition & 0 deletions tests/integration/python/duplicate-output/requirements.txt
@@ -0,0 +1 @@
pulumi

0 comments on commit 04ce92c

Please sign in to comment.