Skip to content

Commit fbf6bbd

Browse files
committed
🐛 fix: address edelauna review feedback (Zoo-Code-Org#632)
- Pin actions/cache to SHA per repo convention - Add VSCode version to e2e cache key - Remove dead teardown code in zai test interceptor - Replace setTimeout(100) with deterministic assertion in zai tests - Change afterAll to afterEach for spy cleanup
1 parent 1cb6d19 commit fbf6bbd

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737

3838
- name: Cache VS Code test binary
3939
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
40-
uses: actions/cache@v4
40+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
4141
with:
4242
path: |
4343
apps/vscode-e2e/.vscode-test/
44-
key: vscode-test-${{ runner.os }}-v1
44+
key: vscode-test-${{ runner.os }}-1.100.0-v1
4545
restore-keys: |
46-
vscode-test-${{ runner.os }}-
46+
vscode-test-${{ runner.os }}-1.100.0-
4747
4848
- name: Run mocked E2E tests
4949
id: run-e2e

apps/vscode-e2e/src/suite/providers/zai.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ function installZAiFetchInterceptor(
7676

7777
return () => {
7878
globalThis.fetch = original
79-
const lastCaptured = capturedRequests[capturedRequests.length - 1]
80-
if (capture && lastCaptured) {
81-
capture.maxTokens = lastCaptured.maxTokens
82-
}
8379
}
8480
}
8581

@@ -226,9 +222,11 @@ suite("Z.ai GLM provider", function () {
226222
})
227223

228224
await waitUntilCompleted({ api, taskId })
229-
// Allow any pending async requests to finish before snapshotting max_tokens
230-
await new Promise((resolve) => setTimeout(resolve, 100))
231225
const capturedMaxTokens = requestCapture.maxTokens
226+
assert.ok(
227+
capturedMaxTokens !== undefined,
228+
"max_tokens should have been captured by the fetch interceptor before task completion",
229+
)
232230

233231
const completionMessage = messages.find(
234232
({ say, text }) => (say === "completion_result" || say === "text") && text?.trim() === "4",
@@ -270,9 +268,11 @@ suite("Z.ai GLM provider", function () {
270268
})
271269

272270
await waitUntilCompleted({ api, taskId })
273-
// Allow any pending async requests to finish before snapshotting max_tokens
274-
await new Promise((resolve) => setTimeout(resolve, 100))
275271
const capturedMaxTokens = requestCapture.maxTokens
272+
assert.ok(
273+
capturedMaxTokens !== undefined,
274+
"max_tokens should have been captured by the fetch interceptor before task completion",
275+
)
276276

277277
const completionMessage = messages.find(
278278
({ say, text }) => (say === "completion_result" || say === "text") && text?.trim() === "4",

0 commit comments

Comments
 (0)