-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for type check warnings (#2389)
This adds a regression test for the warnings we issue to users when a property has the wrong type. This could result in panics down the line, so we need to catch them early. Testing this in the bridge is currently quite hard as we can't use YAML for this because it is too strict in type-checking. We only have unit tests which indirectly test this but these break under PRC. This was introduced in pulumi/pulumi-terraform-bridge#1987 original GCP issue: pulumi/pulumi-terraform-bridge#1979 Bridge issue for integration tests for the feature: pulumi/pulumi-terraform-bridge#2418
- Loading branch information
1 parent
a1f7fa3
commit 99484f2
Showing
8 changed files
with
3,724 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
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,2 @@ | ||
/bin/ | ||
/node_modules/ |
10 changes: 10 additions & 0 deletions
10
provider/test-programs/cloudfunction-wrong-type/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,10 @@ | ||
name: cloudfunction-wrong-type | ||
runtime: | ||
name: nodejs | ||
options: | ||
packagemanager: npm | ||
description: A minimal Google Cloud TypeScript Pulumi program | ||
config: | ||
pulumi:tags: | ||
value: | ||
pulumi:template: gcp-typescript |
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 @@ | ||
console.log("Hello, world!"); |
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,26 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as gcp from "@pulumi/gcp"; | ||
|
||
// Create a GCP resource (Storage Bucket) | ||
const bucket = new gcp.storage.Bucket("my-bucket", { | ||
location: "US" | ||
}); | ||
|
||
const archive = new gcp.storage.BucketObject("archive", { | ||
name: "index.zip", | ||
bucket: bucket.name, | ||
source: new pulumi.asset.FileArchive("./fn"), | ||
}); | ||
|
||
new gcp.cloudfunctions.Function( | ||
`a-function`, | ||
{ | ||
runtime: 'nodejs20', | ||
sourceArchiveBucket: bucket.name, | ||
sourceArchiveObject: archive.name, | ||
entryPoint: "main", | ||
name: 'name', | ||
environmentVariables: [{ a_key: 'A value'}] as any, | ||
triggerHttp: true, | ||
}, | ||
); |
Oops, something went wrong.