-
Notifications
You must be signed in to change notification settings - Fork 90
fix(tests): keep email-list hermetic; don't delete real secure-store credentials #25735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ import { runAssistantCommand } from "../../__tests__/run-assistant-command.js"; | |
|
|
||
| const ASSISTANT_ID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; | ||
| const API_KEY_CREDENTIAL = credentialKey("vellum", "assistant_api_key"); | ||
| const ASSISTANT_ID_CREDENTIAL = credentialKey("vellum", "platform_assistant_id"); | ||
|
|
||
| /** | ||
| * Return the recorded fetch calls, excluding the feature-flag fetch that | ||
|
|
@@ -84,10 +83,6 @@ beforeEach(async () => { | |
| _setOverridesForTesting({ "email-channel": true }); | ||
| setPlatformAssistantId(ASSISTANT_ID); | ||
| await setSecureKeyAsync(API_KEY_CREDENTIAL, "test-api-key"); | ||
| // Ensure the credential store does not contain a stray platform_assistant_id | ||
| // from dev machine state — the "missing assistant ID" test relies on the | ||
| // fallback lookup returning empty. | ||
| await deleteSecureKeyAsync(ASSISTANT_ID_CREDENTIAL); | ||
| }); | ||
|
Comment on lines
85
to
86
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Inconsistency with sibling email test files The Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| afterEach(() => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Removing
deleteSecureKeyAsyncforplatform_assistant_idbreaks test isolation on developer machinesThe removed
deleteSecureKeyAsync(ASSISTANT_ID_CREDENTIAL)call inbeforeEachwas specifically guarding the "missing assistant ID returns error" test (line 201–209). WhensetPlatformAssistantId("")is called,getPlatformAssistantId()returns"". InVellumPlatformClient.create()(assistant/src/platform/client.ts:60-67),!assistantIdevaluates totruefor"", triggering a fallback that readsplatform_assistant_idfrom the encrypted credential store on disk. On developer machines that have a realplatform_assistant_idstored in~/.vellum/protected/keys.enc, this fallback returns the real value, the client gets a non-emptyplatformAssistantId, the!client.platformAssistantIdcheck atassistant/src/cli/commands/email.ts:364passes, and the test fails because the expected error is never thrown. The removed comment explicitly documented this: "the 'missing assistant ID' test relies on the fallback lookup returning empty."Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.