File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,56 @@ func TestParse(t *testing.T) {
325
325
},
326
326
},
327
327
},
328
+ {
329
+ Name : "workspace-tags-duplicate-tag" ,
330
+ Files : map [string ]string {
331
+ "main.tf" : `
332
+
333
+ data "coder_workspace_tags" "custom_workspace_tags" {
334
+ tags = {
335
+ "cluster" = "developers"
336
+ "debug" = "yes"
337
+ "debug" = "no"
338
+ "cache" = "no-cache"
339
+ }
340
+ }
341
+ ` ,
342
+ },
343
+ ErrorContains : `workspace tag "debug" is defined multiple times` ,
344
+ },
345
+ {
346
+ Name : "workspace-tags-wrong-tag-format" ,
347
+ Files : map [string ]string {
348
+ "main.tf" : `
349
+
350
+ data "coder_workspace_tags" "custom_workspace_tags" {
351
+ tags {
352
+ cluster = "developers"
353
+ debug = "yes"
354
+ cache = "no-cache"
355
+ }
356
+ }
357
+ ` ,
358
+ },
359
+ ErrorContains : `"tags" attribute is required by coder_workspace_tags` ,
360
+ },
361
+ {
362
+ Name : "empty-main" ,
363
+ Files : map [string ]string {
364
+ "main.tf" : `` ,
365
+ },
366
+ Response : & proto.ParseComplete {},
367
+ },
368
+ {
369
+ Name : "non-tf-files" ,
370
+ Files : map [string ]string {
371
+ "readme.md" : `Hello world` ,
372
+ "any-file.txt" : "Foobar" ,
373
+ },
374
+ Response : & proto.ParseComplete {
375
+ Readme : []byte ("Hello world" ),
376
+ },
377
+ },
328
378
}
329
379
330
380
for _ , testCase := range testCases {
You can’t perform that action at this time.
0 commit comments