Skip to content

Commit 5a67a5d

Browse files
committed
Update tests for hidden required variables in validator
1 parent dc8ca9f commit 5a67a5d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

internal/orchestrator/app/validator_test.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,8 @@ func TestValidateAppDescriptorBricks(t *testing.T) {
3838
Name: "Hidden variable brick",
3939
Variables: []bricksindex.BrickVariable{
4040
{
41-
Name: "I_AM_HIDDEN",
42-
Description: "I am an hidden variable",
43-
Hidden: true,
44-
},
45-
{
46-
Name: "I_AM_HIDDEN_AND_REQUIRED",
47-
Description: "I am an hidden and required variable",
48-
DefaultValue: "", // Required (no default value)
41+
Name: "I_AM_HIDDEN_WITHOUT_DEFAULT",
42+
Hidden: true,
4943
},
5044
},
5145
},
@@ -154,13 +148,13 @@ bricks:
154148
expectedError: nil,
155149
},
156150
{
157-
name: "hidden variables are not required to be set",
151+
name: "is required works also for hidden variables",
158152
yamlContent: `
159153
name: App with
160154
bricks:
161155
- arduino:brick-with-hidden-variable:
162156
`,
163-
expectedError: nil,
157+
expectedError: errors.New("variable \"I_AM_HIDDEN_WITHOUT_DEFAULT\" is required by brick \"arduino:brick-with-hidden-variable\""),
164158
},
165159
}
166160

0 commit comments

Comments
 (0)