| 168 | } |
| 169 | |
| 170 | func TestExpMcpServerNoCredentials(t *testing.T) { |
| 171 | t.Parallel() |
| 172 | |
| 173 | ctx := testutil.Context(t, testutil.WaitShort) |
| 174 | cancelCtx, cancel := context.WithCancel(ctx) |
| 175 | t.Cleanup(cancel) |
| 176 | |
| 177 | client := coderdtest.New(t, nil) |
| 178 | socketPath := filepath.Join(t.TempDir(), "nonexistent.sock") |
| 179 | inv, root := clitest.New(t, |
| 180 | "exp", "mcp", "server", |
| 181 | "--socket-path", socketPath, |
| 182 | ) |
| 183 | inv = inv.WithContext(cancelCtx) |
| 184 | |
| 185 | pty := ptytest.New(t) |
| 186 | inv.Stdin = pty.Input() |
| 187 | inv.Stdout = pty.Output() |
| 188 | clitest.SetupConfig(t, client, root) |
| 189 | |
| 190 | err := inv.Run() |
| 191 | assert.ErrorContains(t, err, "are not logged in") |
| 192 | } |
| 193 | |
| 194 | func TestExpMcpConfigureClaudeCode(t *testing.T) { |
| 195 | t.Parallel() |