-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip unknowns in Check to avoid panic when marshalling Build object (#…
…575) * Skip unknowns in Check to avoid panic when marshalling Build object * Add unknowns integration test for TypeScript and YAML
- Loading branch information
1 parent
8ff68a2
commit b038b1a
Showing
10 changed files
with
148 additions
and
1 deletion.
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
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,42 @@ | ||
// | ||
// 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. | ||
//go:build go || all | ||
// +build go all | ||
|
||
package examples | ||
|
||
import ( | ||
"github.com/pulumi/pulumi/pkg/v3/testing/integration" | ||
"github.com/stretchr/testify/assert" | ||
"os" | ||
"path" | ||
"testing" | ||
) | ||
|
||
func TestUnknownInputsYAML(t *testing.T) { | ||
cwd, err := os.Getwd() | ||
if !assert.NoError(t, err) { | ||
t.FailNow() | ||
} | ||
|
||
integration.ProgramTest(t, &integration.ProgramTestOptions{ | ||
Dir: path.Join(cwd, "test-unknowns", "yaml"), | ||
Quick: true, | ||
SkipRefresh: true, | ||
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { | ||
randID, ok := stack.Outputs["randNameId"] | ||
assert.True(t, ok) | ||
assert.NotEmpty(t, randID) | ||
}, | ||
}) | ||
} |
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,8 @@ | ||
FROM ubuntu AS base | ||
RUN echo "base" | ||
|
||
FROM base AS stage1 | ||
RUN echo "stage1" | ||
|
||
FROM base AS stage2 | ||
RUN echo "stage2" |
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,3 @@ | ||
name: test-unknowns | ||
runtime: nodejs | ||
description: A minimal TypeScript Pulumi program |
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 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as docker from "@pulumi/docker"; | ||
import * as random from "@pulumi/random"; | ||
|
||
|
||
|
||
const randName = new random.RandomString("random", { | ||
length: 10, | ||
|
||
}); | ||
|
||
const img = new docker.Image("docker-565-one", { | ||
imageName: "pulumibot/test-image:with-build-args", | ||
|
||
build: { | ||
args: { | ||
"RANDOM_ARG": randName.id | ||
}, | ||
}, | ||
skipPush: true, | ||
}); | ||
|
||
export const randnameid = randName.id |
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,11 @@ | ||
{ | ||
"name": "test-unknowns", | ||
"devDependencies": { | ||
"@types/node": "^14.0.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/docker": "^4.1.0", | ||
"@pulumi/random": "^4.12.1", | ||
"@pulumi/pulumi": "^3.0.0" | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"outDir": "bin", | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
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,8 @@ | ||
FROM ubuntu AS base | ||
RUN echo "base" | ||
|
||
FROM base AS stage1 | ||
RUN echo "stage1" | ||
|
||
FROM base AS stage2 | ||
RUN echo "stage2" |
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,19 @@ | ||
name: dockerfile-default-context | ||
runtime: yaml | ||
resources: | ||
randName: | ||
type: random:RandomString | ||
properties: | ||
length: 8 | ||
demo-image: | ||
type: docker:Image | ||
properties: | ||
imageName: pulumibot/test-unknowns:yaml | ||
skipPush: true | ||
build: | ||
args: | ||
RANDOM_ARG: ${randName.id} | ||
options: | ||
version: v4.1.0 | ||
outputs: | ||
randNameId: ${randName.id} |
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