Skip to content

feat: store coder_workspace_tags in the database #13294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
May 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more unit tests
  • Loading branch information
mtojek committed May 20, 2024
commit 0e710c7b5bb995738ef4af2be2e5c5eed770b115
50 changes: 50 additions & 0 deletions provisioner/terraform/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,56 @@ func TestParse(t *testing.T) {
},
},
},
{
Name: "workspace-tags-duplicate-tag",
Files: map[string]string{
"main.tf": `

data "coder_workspace_tags" "custom_workspace_tags" {
tags = {
"cluster" = "developers"
"debug" = "yes"
"debug" = "no"
"cache" = "no-cache"
}
}
`,
},
ErrorContains: `workspace tag "debug" is defined multiple times`,
},
{
Name: "workspace-tags-wrong-tag-format",
Files: map[string]string{
"main.tf": `

data "coder_workspace_tags" "custom_workspace_tags" {
tags {
cluster = "developers"
debug = "yes"
cache = "no-cache"
}
}
`,
},
ErrorContains: `"tags" attribute is required by coder_workspace_tags`,
},
{
Name: "empty-main",
Files: map[string]string{
"main.tf": ``,
},
Response: &proto.ParseComplete{},
},
{
Name: "non-tf-files",
Files: map[string]string{
"readme.md": `Hello world`,
"any-file.txt": "Foobar",
},
Response: &proto.ParseComplete{
Readme: []byte("Hello world"),
},
},
}

for _, testCase := range testCases {
Expand Down
Loading