Skip to content

Commit

Permalink
Turn on more tests, record remaining failures (#679)
Browse files Browse the repository at this point in the history
This turns on the remaining already passing conformance tests for YAML,
and records a reason why the remaining failing tests are failing.
  • Loading branch information
Frassle authored Nov 15, 2024
1 parent 6dd3761 commit 3e70006
Show file tree
Hide file tree
Showing 61 changed files with 416 additions and 24 deletions.
33 changes: 9 additions & 24 deletions cmd/pulumi-language-yaml/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,30 +172,15 @@ func runTestingHost(t *testing.T) (string, testingrpc.LanguageTestClient) {

// Add test names here that are expected to fail and the reason why they are failing
var expectedFailures = map[string]string{
"l1-stack-reference": "TODO",
"l2-destroy": "TODO",
"l2-invoke-options": "TODO",
"l2-map-keys": "TODO",
"l2-provider-grpc-config-schema-secret": "TODO",
"l2-resource-config": "TODO",
"l2-engine-update-options": "TODO",
"l2-invoke-secrets": "TODO",
"l2-parameterized-resource": "TODO",
"l2-provider-grpc-config-secret": "TODO",
"l2-resource-primitives": "TODO",
"l2-explicit-provider": "TODO",
"l2-invoke-simple": "TODO",
"l2-plain": "TODO",
"l2-ref-ref": "TODO",
"l2-failed-create-continue-on-error": "TODO",
"l2-invoke-variants": "TODO",
"l2-primitive-ref": "TODO",
"l2-resource-alpha": "TODO",
"l2-target-up-with-new-dependency": "TODO",
"l2-invoke-dependencies": "TODO",
"l2-large-string": "TODO",
"l2-provider-grpc-config": "TODO",
"l2-resource-asset-archive": "TODO",
"l1-stack-reference": "YAML does not support fn::getOutput",
"l2-invoke-options": "cannot assign expression",
"l2-map-keys": "missing expected dependency primitive",
"l2-provider-grpc-config-schema-secret": "Detected a secret leak in state",
"l2-invoke-secrets": "YAML does not support fn::secret",
"l2-parameterized-resource": "could not load schema for subpackage, provider not known",
"l2-failed-create-continue-on-error": "missing expected dependency fail_on_create",
"l2-invoke-dependencies": "missing expected dependency simple-invoke",
"l2-resource-asset-archive": "Argument must be a constant or contained in the project dir",
}

func TestLanguage(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
aresource:
type: simple:Resource
properties:
value: true
other:
type: simple:Resource
properties:
value: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-destroy
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple
version: 2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
aresource:
type: simple:Resource
properties:
value: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-destroy
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple
version: 2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
target:
type: simple:Resource
properties:
value: true
other:
type: simple:Resource
properties:
value: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-engine-update-options
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple
version: 2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
prov:
type: pulumi:providers:simple
res:
type: simple:Resource
properties:
value: true
options:
provider: ${prov}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-explicit-provider
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple
version: 2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
outputs:
hello:
fn::invoke:
Function: simple-invoke:myInvoke
Arguments:
value: hello
Return: result
goodbye:
fn::invoke:
Function: simple-invoke:myInvoke
Arguments:
value: goodbye
Return: result
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-invoke-simple
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple-invoke
version: 10.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resources:
res:
type: simple-invoke:StringResource
outputs:
outputInput:
fn::invoke:
Function: simple-invoke:myInvoke
Arguments:
value: ${res.text}
Return: result
unit:
fn::invoke:
Function: simple-invoke:unit
Arguments: {}
Return: result
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-invoke-variants
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: simple-invoke
version: 10.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
res:
type: large:String
properties:
value: hello world
outputs:
output: ${res.value}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-large-string
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: large
version: 4.3.2
26 changes: 26 additions & 0 deletions cmd/pulumi-language-yaml/testdata/projects/l2-plain/Main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resources:
res:
type: plain:Resource
properties:
data:
innerData:
boolean: false
float: 2.17
integer: -12
string: Goodbye
boolArray:
- false
- true
stringMap:
two: turtle doves
three: french hens
boolean: true
float: 4.5
integer: 1024
string: Hello
boolArray:
- true
- false
stringMap:
x: '100'
y: '200'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-plain
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: plain
version: 13.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resources:
res:
type: primitive-ref:Resource
properties:
data:
boolean: false
float: 2.17
integer: -12
string: Goodbye
boolArray:
- false
- true
stringMap:
two: turtle doves
three: french hens
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-primitive-ref
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: primitive-ref
version: 11.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
resources:
# This provider covers scenarios where user passes secret values to the provider.
config_grpc_provider:
type: pulumi:providers:config-grpc
properties:
string1:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
string1: SECRET
Return: string1
int1:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
int1: 1.23456789e+09
Return: int1
num1:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
num1: 123456.789
Return: num1
bool1:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
bool1: true
Return: bool1
listString1:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
listString1:
- SECRET
- SECRET2
Return: listString1
listString2: # TODO[pulumi/pulumi#17535] this currently breaks Go compilation unfortunately.
# # mapString1 = invoke("config-grpc:index:toSecret", {mapString1 = { key1 = "SECRET", key2 = "SECRET2" }}).mapString1
- VALUE
- fn::invoke:
Function: config-grpc:toSecret
Arguments:
string1: SECRET
Return: string1
mapString2: # TODO[pulumi/pulumi#17535] this breaks Go compilation as well.
# # os1 = invoke("config-grpc:index:toSecret", {objString1 = { x = "SECRET" }}).objString1
key1: value1
key2:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
string1: SECRET
Return: string1
objString2:
x:
fn::invoke:
Function: config-grpc:toSecret
Arguments:
string1: SECRET
Return: string1
config:
type: config-grpc:ConfigFetcher
options:
provider: ${config_grpc_provider}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-provider-grpc-config-secret
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: config-grpc
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
resources:
# Cover interesting schema shapes.
config_grpc_provider:
type: pulumi:providers:config-grpc
properties:
string1: ""
string2: x
# Test a JSON-like string to see if it trips up JSON detectors.
string3: '{}'
int1: 0
int2: 42
num1: 0
num2: 42.42
bool1: true
bool2: false
listString1: []
listString2:
- ""
- foo
listInt1:
- 1
- 2
mapString1: {}
mapString2:
key1: value1
key2: value2
mapInt1:
key1: 0
key2: 42
objString1: {}
objString2:
x: x-value
objInt1:
x: 42
config:
type: config-grpc:ConfigFetcher
options:
provider: ${config_grpc_provider}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-provider-grpc-config
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: config-grpc
version: 1.0.0
24 changes: 24 additions & 0 deletions cmd/pulumi-language-yaml/testdata/projects/l2-ref-ref/Main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resources:
res:
type: ref-ref:Resource
properties:
data:
innerData:
boolean: false
float: 2.17
integer: -12
string: Goodbye
boolArray:
- false
- true
stringMap:
two: turtle doves
three: french hens
boolean: true
float: 4.5
integer: 1024
string: Hello
boolArray: []
stringMap:
x: '100'
y: '200'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-ref-ref
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: ref-ref
version: 12.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
res:
type: alpha:Resource
properties:
value: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-resource-alpha
runtime: yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageDeclarationVersion: 1
name: alpha
version: 3.0.0-alpha.1.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
prov:
type: pulumi:providers:config
properties:
name: my config
pluginDownloadURL: not the same as the pulumi resource option
# Note this isn't _using_ the explicit provider, it's just grabbing a value from it.
res:
type: config:Resource
properties:
text: ${prov.version}
outputs:
pluginDownloadURL: ${prov.pluginDownloadURL}
Loading

0 comments on commit 3e70006

Please sign in to comment.