Compare commits

...

1 Commits

Author SHA1 Message Date
core-devops 279ed687df fix(tests): restore correct assertions broken by merge conflict resolution
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 13s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 33s
CI / Detect changes (pull_request) Successful in 40s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m21s
Harness Replays / detect-changes (pull_request) Successful in 19s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m22s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m24s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 23s
qa-review / approved (pull_request) Failing after 17s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 57s
security-review / approved (pull_request) Failing after 19s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m47s
Harness Replays / Harness Replays (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 17s
CI / Python Lint & Test (pull_request) Successful in 7m52s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m7s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 9s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6m3s
CI / Canvas (Next.js) (pull_request) Successful in 16m56s
sop-checklist / all-items-acked (pull_request) Successful in 21s
gate-check-v3 / gate-check (pull_request) Successful in 32s
sop-tier-check / tier-check (pull_request) Successful in 18s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 18m21s
CI / all-required (pull_request) Failing after 18m34s
CI / Canvas Deploy Reminder (pull_request) Successful in 3s
Two test assertions were corrupted during merge conflict resolution in
9ce48488 (CWE-78 guard + rows.Err merge):

1. TestInstructionsHandler_Create_Success: mock returns new-inst-id (the
   ID the handler would generate) but assertion still expected new-inst-1.
   Fix: align assertion with mock.

2. TestInstructionsList_ByWorkspaceID: merge changed expected count from 2
   to 0, but the handler correctly returns both global + workspace-scoped
   instructions for a workspace_id (scope = 'global' OR scope = 'workspace'
   AND scope_target = $1). The original test expected 2 and verified the
   first row was global. Fix: restore original expected count + scope check.

Both bugs are pre-existing in the test file — the underlying handler logic
is correct. Tests pass locally.

Fixes: molecule-core#1090 (main-red)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 23:20:57 +00:00
@@ -86,8 +86,11 @@ func TestInstructionsList_ByWorkspaceID(t *testing.T) {
if err := json.Unmarshal(w.Body.Bytes(), &result); err != nil {
t.Fatalf("invalid JSON: %v", err)
}
if len(result) != 0 {
t.Fatalf("expected 0 instructions, got %d", len(result))
if len(result) != 2 {
t.Fatalf("expected 2 instructions, got %d", len(result))
}
if result[0].Scope != "global" {
t.Errorf("first row scope: expected global, got %s", result[0].Scope)
}
if err := mock.ExpectationsWereMet(); err != nil {
t.Fatalf("unmet expectations: %v", err)
@@ -216,8 +219,8 @@ func TestInstructionsHandler_Create_Success(t *testing.T) {
if err := json.Unmarshal(w.Body.Bytes(), &out); err != nil {
t.Fatalf("response not valid JSON: %v", err)
}
if out["id"] != "new-inst-1" {
t.Errorf("expected id new-inst-1, got %s", out["id"])
if out["id"] != "new-inst-id" {
t.Errorf("expected id new-inst-id, got %s", out["id"])
}
if err := mock.ExpectationsWereMet(); err != nil {
t.Errorf("unmet expectations: %v", err)