@@ -9,8 +9,8 @@ run "defaults_noninteractive" {
99 }
1010
1111 assert {
12- condition = can (regex (" BINARY_NAME='cursor-agent' " , resource. coder_script . cursor_cli . script ))
13- error_message = " Expected default binary_name to be cursor-agent "
12+ condition = can (regex (" Cursor CLI " , resource. coder_script . cursor_cli . display_name ))
13+ error_message = " Expected coder_script to be created "
1414 }
1515}
1616
@@ -19,15 +19,13 @@ run "non_interactive_mode" {
1919
2020 variables {
2121 agent_id = " test-agent"
22- base_command = " status"
23- extra_args = [" --dry-run" ]
2422 output_format = " json"
2523 }
2624
2725 assert {
28- // base command and -p -- output- format json are included in env
29- condition = can (regex (" BASE_COMMAND='status '" , resource. coder_script . cursor_cli . script ))
30- error_message = " Expected BASE_COMMAND to be propagated"
26+ // non-interactive always prints; output format propagates
27+ condition = can (regex (" OUTPUT_FORMAT='json '" , resource. coder_script . cursor_cli . script ))
28+ error_message = " Expected OUTPUT_FORMAT to be propagated"
3129 }
3230}
3331
@@ -55,36 +53,13 @@ run "additional_settings_propagated" {
5553 command = plan
5654
5755 variables {
58- agent_id = " test-agent"
59- additional_settings = jsonencode ({
60- mcpServers = {
61- coder = {
62- command = " coder"
63- args = [" exp" , " mcp" , " server" ]
64- type = " stdio"
65- }
66- }
67- })
56+ agent_id = " test-agent"
6857 mcp_json = jsonencode ({ mcpServers = { foo = { command = " foo" , type = " stdio" } } })
6958 rules_files = {
7059 " global.yml" = " version: 1\n rules:\n - name: global\n include: ['**/*']\n description: global rule"
7160 }
7261 }
7362
74- // Ensure the encoded settings are passed into the install invocation
75- assert {
76- condition = can (regex (base64encode (jsonencode ({
77- mcpServers = {
78- coder = {
79- command = " coder"
80- args = [" exp" , " mcp" , " server" ]
81- type = " stdio"
82- }
83- }
84- })), resource. coder_script . cursor_cli . script ))
85- error_message = " Expected ADDITIONAL_SETTINGS (base64) to be in the install step"
86- }
87-
8863 // Ensure project mcp_json is passed
8964 assert {
9065 condition = can (regex (base64encode (jsonencode ({ mcpServers = { foo = { command = " foo" , type = " stdio" } } })), resource. coder_script . cursor_cli . script ))
@@ -98,16 +73,13 @@ run "additional_settings_propagated" {
9873 }
9974}
10075
101- run "output_api_key_binary_basecmd_extra " {
76+ run "output_api_key " {
10277 command = plan
10378
10479 variables {
10580 agent_id = " test-agent"
10681 output_format = " json"
10782 api_key = " sk-test-123"
108- binary_name = " cursor-agent"
109- base_command = " status"
110- extra_args = [" --foo" , " bar" ]
11183 }
11284
11385 assert {
@@ -119,19 +91,4 @@ run "output_api_key_binary_basecmd_extra" {
11991 condition = can (regex (" API_KEY_SECRET='sk-test-123'" , resource. coder_script . cursor_cli . script ))
12092 error_message = " Expected API key to be plumbed (to CURSOR_API_KEY at runtime)"
12193 }
122-
123- assert {
124- condition = can (regex (" BINARY_NAME='cursor-agent'" , resource. coder_script . cursor_cli . script ))
125- error_message = " Expected binary name to be forwarded"
126- }
127-
128- assert {
129- condition = can (regex (" BASE_COMMAND='status'" , resource. coder_script . cursor_cli . script ))
130- error_message = " Expected base command to be forwarded"
131- }
132-
133- assert {
134- condition = can (regex (base64encode (" --foo\n bar" ), resource. coder_script . cursor_cli . script ))
135- error_message = " Expected extra args to be base64 encoded and passed"
136- }
13794}
0 commit comments