Skip to content

fix(tests): add EXISTS probe mock to 4 WorkspaceUpdate tests (post #125) - #161

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/broken-update-tests-post-125
Apr 15, 2026
Merged

fix(tests): add EXISTS probe mock to 4 WorkspaceUpdate tests (post #125)#161
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/broken-update-tests-post-125

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

#125 broke the 4 WorkspaceUpdate sqlmock tests by adding an EXISTS probe before the UPDATE. CI didn't catch it because the Actions billing cap is still blocking runs; only caught locally when running full suite for #110/#119 verification. Adds the missing ExpectQuery mock. go test -race green locally.

#125 added a SELECT EXISTS guard before WorkspaceHandler.Update applies
any UPDATE so nonexistent workspace IDs return 404 instead of silent
zero-row successes. The 4 existing WorkspaceUpdate_* sqlmock tests
didn't mock the probe, so they broke on main. This was not caught
because CI is blocked by the Actions billing cap.

Adds ExpectQuery for the EXISTS probe to:
- TestWorkspaceUpdate_ParentID
- TestWorkspaceUpdate_NameOnly
- TestWorkspaceUpdate_MultipleFields
- TestWorkspaceUpdate_RuntimeField

TestWorkspaceUpdate_BadJSON doesn't need the fix — it aborts on
c.ShouldBindJSON before reaching the guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit bf4a0bc into main Apr 15, 2026
0 of 6 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/broken-update-tests-post-125 branch April 16, 2026 12:30
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…-125

fix(tests): add EXISTS probe mock to 4 WorkspaceUpdate tests (post #125)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant