chore(cli): fix test flake when running in coder workspace (#17604)

This test was failing inside a Coder workspace due to
`CODER_AGENT_TOKEN` being set.
This commit is contained in:
Cian Johnston
2025-04-30 09:18:58 +01:00
committed by GitHub
parent 7a1e56b707
commit d7e6eb7914

View File

@ -158,6 +158,7 @@ func TestExpMcpServer(t *testing.T) {
//nolint:tparallel,paralleltest //nolint:tparallel,paralleltest
func TestExpMcpConfigureClaudeCode(t *testing.T) { func TestExpMcpConfigureClaudeCode(t *testing.T) {
t.Run("NoReportTaskWhenNoAgentToken", func(t *testing.T) { t.Run("NoReportTaskWhenNoAgentToken", func(t *testing.T) {
t.Setenv("CODER_AGENT_TOKEN", "")
ctx := testutil.Context(t, testutil.WaitShort) ctx := testutil.Context(t, testutil.WaitShort)
cancelCtx, cancel := context.WithCancel(ctx) cancelCtx, cancel := context.WithCancel(ctx)
t.Cleanup(cancel) t.Cleanup(cancel)