-
Notifications
You must be signed in to change notification settings - Fork 78
test: add terraform tests to kiro module #529
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
+124
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| run "required_vars" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| } | ||
| } | ||
|
|
||
| run "default_output" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| } | ||
|
|
||
| assert { | ||
| condition = output.kiro_url == "kiro://coder.coder-remote/open?owner=default&workspace=default&url=https://mydeployment.coder.com&token=$SESSION_TOKEN" | ||
| error_message = "Default kiro_url must match expected value" | ||
| } | ||
|
|
||
| assert { | ||
| condition = coder_app.kiro.order == null | ||
| error_message = "coder_app order must be null by default" | ||
| } | ||
| } | ||
|
|
||
| run "adds_folder" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| folder = "/foo/bar" | ||
| } | ||
|
|
||
| assert { | ||
| condition = output.kiro_url == "kiro://coder.coder-remote/open?owner=default&workspace=default&folder=/foo/bar&url=https://mydeployment.coder.com&token=$SESSION_TOKEN" | ||
| error_message = "URL must include folder parameter" | ||
| } | ||
| } | ||
|
|
||
| run "folder_and_open_recent" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| folder = "/foo/bar" | ||
| open_recent = true | ||
| } | ||
|
|
||
| assert { | ||
| condition = output.kiro_url == "kiro://coder.coder-remote/open?owner=default&workspace=default&folder=/foo/bar&openRecent&url=https://mydeployment.coder.com&token=$SESSION_TOKEN" | ||
| error_message = "URL must include folder and openRecent parameters" | ||
| } | ||
| } | ||
|
|
||
| run "custom_slug_display_name" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| slug = "kiro-ai" | ||
| display_name = "Kiro AI IDE" | ||
| } | ||
|
|
||
| assert { | ||
| condition = coder_app.kiro.slug == "kiro-ai" | ||
| error_message = "coder_app slug must be set to kiro-ai" | ||
| } | ||
|
|
||
| assert { | ||
| condition = coder_app.kiro.display_name == "Kiro AI IDE" | ||
| error_message = "coder_app display_name must be set to Kiro AI IDE" | ||
| } | ||
| } | ||
|
|
||
| run "sets_order" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| order = 5 | ||
| } | ||
|
|
||
| assert { | ||
| condition = coder_app.kiro.order == 5 | ||
| error_message = "coder_app order must be set to 5" | ||
| } | ||
| } | ||
|
|
||
| run "sets_group" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| group = "AI IDEs" | ||
| } | ||
|
|
||
| assert { | ||
| condition = coder_app.kiro.group == "AI IDEs" | ||
| error_message = "coder_app group must be set to AI IDEs" | ||
| } | ||
| } | ||
|
|
||
| run "writes_mcp_json" { | ||
| command = plan | ||
|
|
||
| variables { | ||
| agent_id = "foo" | ||
| mcp = jsonencode({ | ||
| servers = { | ||
| demo = { url = "http://localhost:1234" } | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| assert { | ||
| condition = strcontains(coder_script.kiro_mcp[0].script, base64encode(jsonencode({ | ||
| servers = { | ||
| demo = { url = "http://localhost:1234" } | ||
| } | ||
| }))) | ||
| error_message = "coder_script must contain base64-encoded MCP JSON" | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.