Skip to content

Commit 9152f91

Browse files
committed
test: remove TEST_USER_ID constant
1 parent 2597c7a commit 9152f91

20 files changed

+36
-53
lines changed

common/src/testing/constants.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

common/src/testing/fixtures/agent-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const TEST_AGENT_RUNTIME_IMPL = Object.freeze<
5959

6060
// Database
6161
getUserInfoFromApiKey: async () => ({
62-
id: 'test-user-id',
62+
id: 'user-123',
6363
email: 'test-email',
6464
discord_id: 'test-discord-id',
6565
referral_code: 'ref-test-code',

evals/impl/agent-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const EVALS_AGENT_RUNTIME_IMPL = Object.freeze<AgentRuntimeDeps>({
3333

3434
// Database
3535
getUserInfoFromApiKey: async () => ({
36-
id: 'test-user-id',
36+
id: 'user-123',
3737
email: 'test-email',
3838
discord_id: 'test-discord-id',
3939
referral_code: 'ref-test-code',

evals/scaffolding.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { assembleLocalAgentTemplates } from '@codebuff/agent-runtime/templates/a
77
import { getFileTokenScores } from '@codebuff/code-map/parse'
88
import { clientToolCallSchema } from '@codebuff/common/tools/list'
99
import { API_KEY_ENV_VAR } from '@codebuff/common/old-constants'
10-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
1110
import { generateCompactId } from '@codebuff/common/util/string'
1211
import { getSystemInfo } from '@codebuff/common/util/system-info'
1312
import { ToolHelpers } from '@codebuff/sdk'
@@ -257,7 +256,7 @@ export async function runAgentStepScaffolding(
257256
spawnParams: undefined,
258257
system: 'Test system prompt',
259258
tools: {},
260-
userId: TEST_USER_ID,
259+
userId: 'user-123',
261260
userInputId: generateCompactId(),
262261
})
263262

packages/agent-runtime/src/__tests__/fast-rewrite.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import path from 'path'
22

3-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
43
import { TEST_AGENT_RUNTIME_IMPL } from '@codebuff/common/testing/impl/agent-runtime'
54
import { afterAll, beforeEach, describe, expect, it } from 'bun:test'
65
import { createPatch } from 'diff'
@@ -34,7 +33,7 @@ describe.skip('rewriteWithOpenAI', () => {
3433
clientSessionId: 'clientSessionId',
3534
fingerprintId: 'fingerprintId',
3635
userInputId: 'userInputId',
37-
userId: TEST_USER_ID,
36+
userId: 'user-123',
3837
runId: 'test-run-id',
3938
})
4039

packages/agent-runtime/src/__tests__/loop-agent-steps.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as analytics from '@codebuff/common/analytics'
2-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
32
import {
43
mockAnalytics,
54
mockBigQuery,
@@ -113,7 +112,7 @@ describe('loopAgentSteps - runAgentStep vs runProgrammaticStep behavior', () =>
113112
spawnParams: undefined,
114113
fingerprintId: 'test-fingerprint',
115114
fileContext: mockFileContext,
116-
userId: TEST_USER_ID,
115+
userId: 'user-123',
117116
clientSessionId: 'test-session',
118117
ancestorRunIds: [],
119118
onResponseChunk: () => {},

packages/agent-runtime/src/__tests__/main-prompt.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as bigquery from '@codebuff/bigquery'
22
import * as analytics from '@codebuff/common/analytics'
3-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
43
import {
54
mockAnalytics,
65
mockBigQuery,
@@ -97,7 +96,7 @@ describe('mainPrompt', () => {
9796
...TEST_AGENT_RUNTIME_IMPL,
9897
repoId: undefined,
9998
repoUrl: undefined,
100-
userId: TEST_USER_ID,
99+
userId: 'user-123',
101100
clientSessionId: 'test-session',
102101
onResponseChunk: () => {},
103102
localAgentTemplates: mockLocalAgentTemplates,
@@ -414,7 +413,7 @@ describe('mainPrompt', () => {
414413
repoId: undefined,
415414
repoUrl: undefined,
416415
action,
417-
userId: TEST_USER_ID,
416+
userId: 'user-123',
418417
clientSessionId: 'test-session',
419418
onResponseChunk: () => {},
420419
localAgentTemplates: mockLocalAgentTemplates,

packages/agent-runtime/src/__tests__/n-parameter.test.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as analytics from '@codebuff/common/analytics'
2-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
32
import {
43
mockAnalytics,
54
mockRandomUUID,
@@ -106,7 +105,7 @@ describe('n parameter and GENERATE_N functionality', () => {
106105
ancestorRunIds: [],
107106
repoId: undefined,
108107
repoUrl: undefined,
109-
userId: TEST_USER_ID,
108+
userId: 'user-123',
110109
userInputId: 'test-input',
111110
clientSessionId: 'test-session',
112111
fingerprintId: 'test-fingerprint',
@@ -244,7 +243,7 @@ describe('n parameter and GENERATE_N functionality', () => {
244243
template: mockTemplate,
245244
prompt: 'Test prompt',
246245
toolCallParams: {},
247-
userId: TEST_USER_ID,
246+
userId: 'user-123',
248247
userInputId: 'test-user-input',
249248
clientSessionId: 'test-session',
250249
fingerprintId: 'test-fingerprint',
@@ -284,7 +283,7 @@ describe('n parameter and GENERATE_N functionality', () => {
284283
template: mockTemplate,
285284
prompt: 'Test prompt',
286285
toolCallParams: {},
287-
userId: TEST_USER_ID,
286+
userId: 'user-123',
288287
userInputId: 'test-user-input',
289288
clientSessionId: 'test-session',
290289
fingerprintId: 'test-fingerprint',
@@ -349,7 +348,7 @@ describe('n parameter and GENERATE_N functionality', () => {
349348
template: mockTemplate,
350349
prompt: 'Test prompt',
351350
toolCallParams: {},
352-
userId: TEST_USER_ID,
351+
userId: 'user-123',
353352
userInputId: 'test-user-input',
354353
clientSessionId: 'test-session',
355354
fingerprintId: 'test-fingerprint',
@@ -432,7 +431,7 @@ describe('n parameter and GENERATE_N functionality', () => {
432431
template: mockTemplate,
433432
prompt: 'Test',
434433
toolCallParams: {},
435-
userId: TEST_USER_ID,
434+
userId: 'user-123',
436435
userInputId: 'test-input',
437436
clientSessionId: 'test-session',
438437
fingerprintId: 'test-fingerprint',
@@ -528,7 +527,7 @@ describe('n parameter and GENERATE_N functionality', () => {
528527
template: mockTemplate,
529528
prompt: 'Test',
530529
toolCallParams: {},
531-
userId: TEST_USER_ID,
530+
userId: 'user-123',
532531
userInputId: 'test-input',
533532
clientSessionId: 'test-session',
534533
fingerprintId: 'test-fingerprint',
@@ -593,7 +592,7 @@ describe('n parameter and GENERATE_N functionality', () => {
593592
template: mockTemplate,
594593
prompt: 'Test',
595594
toolCallParams: {},
596-
userId: TEST_USER_ID,
595+
userId: 'user-123',
597596
userInputId: 'test-input',
598597
clientSessionId: 'test-session',
599598
fingerprintId: 'test-fingerprint',
@@ -632,7 +631,7 @@ describe('n parameter and GENERATE_N functionality', () => {
632631
template: mockTemplate,
633632
prompt: 'Test',
634633
toolCallParams: {},
635-
userId: TEST_USER_ID,
634+
userId: 'user-123',
636635
userInputId: 'test-input',
637636
clientSessionId: 'test-session',
638637
fingerprintId: 'test-fingerprint',
@@ -679,7 +678,7 @@ describe('n parameter and GENERATE_N functionality', () => {
679678
template: mockTemplate,
680679
prompt: 'Test',
681680
toolCallParams: {},
682-
userId: TEST_USER_ID,
681+
userId: 'user-123',
683682
userInputId: 'test-input',
684683
clientSessionId: 'test-session',
685684
fingerprintId: 'test-fingerprint',
@@ -723,7 +722,7 @@ describe('n parameter and GENERATE_N functionality', () => {
723722
template: mockTemplate,
724723
prompt: 'Test',
725724
toolCallParams: {},
726-
userId: TEST_USER_ID,
725+
userId: 'user-123',
727726
userInputId: 'test-input',
728727
clientSessionId: 'test-session',
729728
fingerprintId: 'test-fingerprint',
@@ -786,7 +785,7 @@ describe('n parameter and GENERATE_N functionality', () => {
786785
template: mockTemplate,
787786
prompt: 'Test',
788787
toolCallParams: {},
789-
userId: TEST_USER_ID,
788+
userId: 'user-123',
790789
userInputId: 'test-input',
791790
clientSessionId: 'test-session',
792791
fingerprintId: 'test-fingerprint',
@@ -834,7 +833,7 @@ describe('n parameter and GENERATE_N functionality', () => {
834833
template: mockTemplate,
835834
prompt: 'Test',
836835
toolCallParams: {},
837-
userId: TEST_USER_ID,
836+
userId: 'user-123',
838837
userInputId: 'test-input',
839838
clientSessionId: 'test-session',
840839
fingerprintId: 'test-fingerprint',

packages/agent-runtime/src/__tests__/process-file-block.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
21
import { TEST_AGENT_RUNTIME_IMPL } from '@codebuff/common/testing/impl/agent-runtime'
32
import { cleanMarkdownCodeBlock } from '@codebuff/common/util/file'
43
import { beforeEach, describe, expect, it } from 'bun:test'
@@ -59,7 +58,7 @@ describe('processFileBlockModule', () => {
5958
clientSessionId: 'clientSessionId',
6059
fingerprintId: 'fingerprintId',
6160
userInputId: 'userInputId',
62-
userId: TEST_USER_ID,
61+
userId: 'user-123',
6362
})
6463

6564
expect(result).not.toBeNull()
@@ -110,7 +109,7 @@ describe('processFileBlockModule', () => {
110109
clientSessionId: 'clientSessionId',
111110
fingerprintId: 'fingerprintId',
112111
userInputId: 'userInputId',
113-
userId: TEST_USER_ID,
112+
userId: 'user-123',
114113
})
115114

116115
expect(result).not.toBeNull()
@@ -144,7 +143,7 @@ describe('processFileBlockModule', () => {
144143
clientSessionId: 'clientSessionId',
145144
fingerprintId: 'fingerprintId',
146145
userInputId: 'userInputId',
147-
userId: TEST_USER_ID,
146+
userId: 'user-123',
148147
})
149148

150149
expect(result).not.toBeNull()
@@ -184,7 +183,7 @@ describe('processFileBlockModule', () => {
184183
clientSessionId: 'clientSessionId',
185184
fingerprintId: 'fingerprintId',
186185
userInputId: 'userInputId',
187-
userId: TEST_USER_ID,
186+
userId: 'user-123',
188187
})
189188

190189
expect(result).not.toBeNull()
@@ -232,7 +231,7 @@ describe('processFileBlockModule', () => {
232231
clientSessionId: 'clientSessionId',
233232
fingerprintId: 'fingerprintId',
234233
userInputId: 'userInputId',
235-
userId: TEST_USER_ID,
234+
userId: 'user-123',
236235
})
237236

238237
expect(result).not.toBeNull()

packages/agent-runtime/src/__tests__/prompt-caching-subagents.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { TEST_USER_ID } from '@codebuff/common/testing/constants'
21
import { TEST_AGENT_RUNTIME_IMPL } from '@codebuff/common/testing/impl/agent-runtime'
32
import { getInitialSessionState } from '@codebuff/common/types/session-state'
43
import { assistantMessage, userMessage } from '@codebuff/common/util/messages'
@@ -131,7 +130,7 @@ describe('Prompt Caching for Subagents with inheritParentSystemPrompt', () => {
131130
fingerprintId: 'test-fingerprint',
132131
fileContext: mockFileContext,
133132
localAgentTemplates: mockLocalAgentTemplates,
134-
userId: TEST_USER_ID,
133+
userId: 'user-123',
135134
clientSessionId: 'test-session',
136135
ancestorRunIds: [],
137136
onResponseChunk: () => {},

0 commit comments

Comments
 (0)