This repository was archived by the owner on Oct 23, 2026. It is now read-only.
Repository navigation
fix(test): fix CI hang, auth guard tests, and PR #610 test rewrite #616
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,8 @@ import { | |
| import { listCommand } from "../../../src/commands/log/list.js"; | ||
| // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking | ||
| import * as apiClient from "../../../src/lib/api-client.js"; | ||
| // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking | ||
| import * as dbAuth from "../../../src/lib/db/auth.js"; | ||
| import { | ||
| AuthError, | ||
| ContextError, | ||
|
|
@@ -237,6 +239,23 @@ const newerLogs: SentryLog[] = [ | |
| }, | ||
| ]; | ||
|
|
||
| // ============================================================================ | ||
| // Auth setup — mock getAuthConfig for all tests (auth guard added in #611) | ||
| // ============================================================================ | ||
|
|
||
| let getAuthConfigSpy: ReturnType<typeof spyOn>; | ||
|
|
||
| beforeEach(() => { | ||
| getAuthConfigSpy = spyOn(dbAuth, "getAuthConfig").mockReturnValue({ | ||
| token: "sntrys_test", | ||
| source: "oauth" as const, | ||
| }); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| getAuthConfigSpy.mockRestore(); | ||
| }); | ||
|
|
||
| // ============================================================================ | ||
| // Standard mode (project-scoped, no trace-id positional) | ||
| // ============================================================================ | ||
|
|
@@ -837,7 +856,14 @@ describe("listCommand.func — flag validation", () => { | |
|
|
||
| test("allows --sort newest with --follow", async () => { | ||
| // Should not throw ValidationError — the error (if any) comes from | ||
| // downstream resolution, not flag validation. | ||
| // downstream resolution, not flag validation. Mock resolution to reject | ||
| // with a non-ValidationError so we can verify flag validation passed. | ||
| const resolveOrgProjectSpy = spyOn( | ||
| resolveTarget, | ||
| "resolveOrgProjectFromArg" | ||
| ).mockRejectedValueOnce( | ||
| new ContextError("Organization", "sentry log list") | ||
| ); | ||
| const { context } = createMockContext(); | ||
| const func = await listCommand.loader(); | ||
| await expect( | ||
|
|
@@ -847,6 +873,7 @@ describe("listCommand.func — flag validation", () => { | |
| "my-org/my-project" | ||
| ) | ||
| ).rejects.not.toThrow(ValidationError); | ||
| resolveOrgProjectSpy.mockRestore(); | ||
|
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. Spy cleanup skipped on assertion failureLow Severity The test creates |
||
| }); | ||
| }); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


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.
Global client closed during reinitialization
Medium Severity
initSentrynow unconditionally callsSentry.getClient()?.close(0)before every init. InlibraryMode, concurrent SDK invocations can close another in-flight invocation’s client, which can drop telemetry and invalidate active spans. It can also close a pre-existing process-wide Sentry client not created by this module.