Merge pull request 'test(store/pgplugin): fix TestStore_PatchNamespace_DualFields using regexp.QuoteMeta' (#857) from fix/test-patchnamespace-dualfields into main
Some checks failed
Block internal-flavored paths / Block forbidden paths (push) Waiting to run
CI / Detect changes (push) Waiting to run
CI / Platform (Go) (push) Blocked by required conditions
CI / Canvas (Next.js) (push) Blocked by required conditions
CI / Shellcheck (E2E scripts) (push) Blocked by required conditions
CI / Canvas Deploy Reminder (push) Blocked by required conditions
CI / Python Lint & Test (push) Blocked by required conditions
CI / all-required (push) Blocked by required conditions
E2E API Smoke Test / detect-changes (push) Waiting to run
E2E API Smoke Test / E2E API Smoke Test (push) Blocked by required conditions
E2E Staging Canvas (Playwright) / detect-changes (push) Waiting to run
E2E Staging Canvas (Playwright) / Canvas tabs E2E (push) Blocked by required conditions
Handlers Postgres Integration / detect-changes (push) Waiting to run
Handlers Postgres Integration / Handlers Postgres Integration (push) Blocked by required conditions
Harness Replays / detect-changes (push) Waiting to run
Harness Replays / Harness Replays (push) Blocked by required conditions
publish-workspace-server-image / build-and-push (push) Waiting to run
Runtime PR-Built Compatibility / detect-changes (push) Waiting to run
Runtime PR-Built Compatibility / PR-built wheel + import smoke (push) Blocked by required conditions
Secret scan / Scan diff for credential-shaped strings (push) Waiting to run
cascade-list-drift-gate / check (pull_request) Successful in 20s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 45s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 20s
Check migration collisions / Migration version collision check (pull_request) Successful in 1m1s
Harness Replays / detect-changes (pull_request) Failing after 54s
publish-runtime-autobump / bump-and-tag (pull_request) Has been skipped
Harness Replays / Harness Replays (pull_request) Has been skipped
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m9s
CI / Detect changes (pull_request) Successful in 1m17s
review-check-tests / review-check.sh regression tests (pull_request) Successful in 23s
publish-runtime-autobump / pr-validate (pull_request) Successful in 56s
MCP Stdio Transport Regression / MCP stdio with regular-file stdout (pull_request) Successful in 1m51s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m25s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 45s
sop-checklist-gate / gate (pull_request) Successful in 13s
sop-tier-check / tier-check (pull_request) Successful in 11s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 2m0s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 1m0s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Failing after 2m6s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m44s
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Successful in 2m21s
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 2m26s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m25s
Runtime Pin Compatibility / PyPI-latest install + import smoke (pull_request) Successful in 2m1s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 25s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m24s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3m26s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 6m45s
CI / Platform (Go) (pull_request) Failing after 6m49s
CI / Python Lint & Test (pull_request) Successful in 8m12s
CI / Canvas (Next.js) (pull_request) Successful in 20m46s
CI / Canvas Deploy Reminder (pull_request) Failing after 14m39s
CI / all-required (pull_request) Failing after 14m34s
Some checks failed
Block internal-flavored paths / Block forbidden paths (push) Waiting to run
CI / Detect changes (push) Waiting to run
CI / Platform (Go) (push) Blocked by required conditions
CI / Canvas (Next.js) (push) Blocked by required conditions
CI / Shellcheck (E2E scripts) (push) Blocked by required conditions
CI / Canvas Deploy Reminder (push) Blocked by required conditions
CI / Python Lint & Test (push) Blocked by required conditions
CI / all-required (push) Blocked by required conditions
E2E API Smoke Test / detect-changes (push) Waiting to run
E2E API Smoke Test / E2E API Smoke Test (push) Blocked by required conditions
E2E Staging Canvas (Playwright) / detect-changes (push) Waiting to run
E2E Staging Canvas (Playwright) / Canvas tabs E2E (push) Blocked by required conditions
Handlers Postgres Integration / detect-changes (push) Waiting to run
Handlers Postgres Integration / Handlers Postgres Integration (push) Blocked by required conditions
Harness Replays / detect-changes (push) Waiting to run
Harness Replays / Harness Replays (push) Blocked by required conditions
publish-workspace-server-image / build-and-push (push) Waiting to run
Runtime PR-Built Compatibility / detect-changes (push) Waiting to run
Runtime PR-Built Compatibility / PR-built wheel + import smoke (push) Blocked by required conditions
Secret scan / Scan diff for credential-shaped strings (push) Waiting to run
cascade-list-drift-gate / check (pull_request) Successful in 20s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 45s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 20s
Check migration collisions / Migration version collision check (pull_request) Successful in 1m1s
Harness Replays / detect-changes (pull_request) Failing after 54s
publish-runtime-autobump / bump-and-tag (pull_request) Has been skipped
Harness Replays / Harness Replays (pull_request) Has been skipped
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m9s
CI / Detect changes (pull_request) Successful in 1m17s
review-check-tests / review-check.sh regression tests (pull_request) Successful in 23s
publish-runtime-autobump / pr-validate (pull_request) Successful in 56s
MCP Stdio Transport Regression / MCP stdio with regular-file stdout (pull_request) Successful in 1m51s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m25s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 45s
sop-checklist-gate / gate (pull_request) Successful in 13s
sop-tier-check / tier-check (pull_request) Successful in 11s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 2m0s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 1m0s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Failing after 2m6s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m44s
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Successful in 2m21s
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 2m26s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m25s
Runtime Pin Compatibility / PyPI-latest install + import smoke (pull_request) Successful in 2m1s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 25s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m24s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3m26s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 6m45s
CI / Platform (Go) (pull_request) Failing after 6m49s
CI / Python Lint & Test (pull_request) Successful in 8m12s
CI / Canvas (Next.js) (pull_request) Successful in 20m46s
CI / Canvas Deploy Reminder (pull_request) Failing after 14m39s
CI / all-required (pull_request) Failing after 14m34s
This commit is contained in:
commit
761c590cd0
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@ -313,8 +314,10 @@ func TestStore_PatchNamespace_DualFields(t *testing.T) {
|
||||
db, mock := setupMockDB(t)
|
||||
store := NewStore(db)
|
||||
exp := time.Now().Add(time.Hour).UTC()
|
||||
// sqlmock matches by query string; we verify the query uses $2 and $3.
|
||||
mock.ExpectQuery("UPDATE memory_namespaces SET expires_at = \\$2, metadata = \\$3 WHERE name = \\$1").
|
||||
// QueryMatcherRegexp (default): expectQuery is a regex. We verify the
|
||||
// query uses $2 and $3 for the dual-field case by checking the full
|
||||
// query pattern. regexp.QuoteMeta handles the $ escaping correctly.
|
||||
mock.ExpectQuery(regexp.QuoteMeta("UPDATE memory_namespaces SET expires_at = $2, metadata = $3 WHERE name = $1")).
|
||||
WithArgs("workspace:abc", sqlmock.AnyArg(), sqlmock.AnyArg()).
|
||||
WillReturnRows(sqlmock.NewRows([]string{"name", "kind", "expires_at", "metadata", "created_at"}).
|
||||
AddRow("workspace:abc", "workspace", exp, []byte(`{}`), time.Now()))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user