Skip to content

Commit 7aa6a98

Browse files
committed
fixing up tests to pass
1 parent 9e7b090 commit 7aa6a98

File tree

8 files changed

+15
-126
lines changed

8 files changed

+15
-126
lines changed

preview_test.go

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ import (
1818
func Test_Extract(t *testing.T) {
1919
t.Parallel()
2020

21+
// nice helper to match tf jsonencode
2122
jsonencode := func(v interface{}) string {
2223
b, err := json.Marshal(v)
2324
if err != nil {
2425
panic(err)
2526
}
2627
return string(b)
2728
}
29+
var _ = jsonencode
2830

2931
for _, tc := range []struct {
3032
skip string
@@ -392,39 +394,7 @@ func Test_Extract(t *testing.T) {
392394
},
393395
},
394396
{
395-
name: "wordle",
396-
dir: "wordle",
397-
expTags: map[string]string{},
398-
input: preview.Input{
399-
PlanJSONPath: "",
400-
ParameterValues: map[string]string{
401-
"one": "curse",
402-
"two": "snake",
403-
},
404-
Owner: types.WorkspaceOwner{},
405-
},
406-
unknownTags: []string{},
407-
params: map[string]assertParam{
408-
"one": ap().value("curse"),
409-
"two": ap().value("snake"),
410-
"three": ap(),
411-
},
412-
},
413-
{
414-
name: "connections",
415-
dir: "connections",
416-
expTags: map[string]string{},
417-
input: preview.Input{
418-
PlanJSONPath: "",
419-
ParameterValues: map[string]string{
420-
"yellow": jsonencode([]string{}),
421-
},
422-
Owner: types.WorkspaceOwner{},
423-
},
424-
unknownTags: []string{},
425-
params: map[string]assertParam{},
426-
},
427-
{
397+
skip: "skip until https://github.com/aquasecurity/trivy/pull/8479 is resolved",
428398
name: "submodcount",
429399
dir: "submodcount",
430400
expTags: map[string]string{},
@@ -439,6 +409,7 @@ func Test_Extract(t *testing.T) {
439409
t.Parallel()
440410
if tc.skip != "" {
441411
t.Skip(tc.skip)
412+
return
442413
}
443414

444415
if tc.unknownTags == nil {

testdata/connections/skipe2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Not valid terraform due to cycles

testdata/formtypes/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ data "coder_parameter" "string_opts_default" {
3737
type = "string"
3838
order = 1
3939
icon = "/emojis/0031-fe0f-20e3.png"
40+
default = local.string_opts[0].value
4041

4142
dynamic "option" {
4243
for_each = local.string_opts
@@ -57,6 +58,7 @@ data "coder_parameter" "string_opts_dropdown" {
5758
form_type = "dropdown"
5859
order = 2
5960
icon = "/emojis/0031-fe0f-20e3.png"
61+
default = local.string_opts[0].value
6062

6163
dynamic "option" {
6264
for_each = local.string_opts
@@ -77,6 +79,7 @@ data "coder_parameter" "string_without_opts" {
7779
type = "string"
7880
order = 3
7981
icon = "/emojis/0031-fe0f-20e3.png"
82+
default = "something random"
8083
}
8184

8285
data "coder_parameter" "textarea_without_opts" {
@@ -87,6 +90,10 @@ data "coder_parameter" "textarea_without_opts" {
8790
form_type = "textarea"
8891
order = 4
8992
icon = "/emojis/0031-fe0f-20e3.png"
93+
default = <<EOT
94+
hello
95+
world
96+
EOT
9097
}
9198

9299
data "coder_parameter" "bool_with_opts" {

testdata/invalid/skipe2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Intentionally invalid

testdata/submodcount/skipe2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Broken until https://github.com/aquasecurity/trivy/pull/8479

testdata/wordle/skipe2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Not valid terraform due to cycles

testdata/wordle_copy/checker/main.tf

Lines changed: 0 additions & 15 deletions
This file was deleted.

testdata/wordle_copy/main.tf

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)