Skip to content

test: reuse the shared sql helper in backup listing tests - #11

Merged
agentHits merged 1 commit into
AgentHits-Devfrom
test/backup-listing-shared-sql-helper
Oct 7, 2026
Merged

agentHits merged 1 commit into
AgentHits-Devfrom
test/backup-listing-shared-sql-helper

Conversation

@agentHits

Copy link
Copy Markdown
Collaborator

What is this PR about?

Test-only cleanup. The listBackupFiles argument-limit test in __test__/backup/restore-security.test.ts (#6) kept its own copy of the json_build_array argument counter. #7 added the same counter as a shared helper, __test__/helpers/postgres-function-args.ts. The test now imports POSTGRES_MAX_FUNCTION_ARGS, maxJsonBuildArrayArgs and relationalQueryDb from there; the local copy and the local drizzle.mock setup are removed.

Checks

  • __test__/backup/restore-security.test.ts: 40 tests pass.
  • The test still catches the bug: with application: true temporarily put back in the backup router, it fails with "expected 101 to be less than or equal to 100".
  • bun run typecheck: 4/4 packages pass.
  • Biome: no errors in the changed file.

No runtime code changes.

🤖 Generated with Claude Code

Что:
- Тест listBackupFiles в __test__/backup/restore-security.test.ts теперь берёт POSTGRES_MAX_FUNCTION_ARGS, maxJsonBuildArrayArgs и relationalQueryDb из общего __test__/helpers/postgres-function-args.ts. Локальная копия счётчика и создание drizzle.mock в тесте удалены.
Зачем:
- Счётчик аргументов json_build_array был в двух копиях: в этом тесте и в общем хелпере. Общий заодно пропускает строки в одинарных кавычках.
Риски:
- Не выявлены, меняется только тест.
Проверки:
- Команды и результаты: CI=true bunx vitest run --config __test__/vitest.config.ts __test__/backup/restore-security.test.ts - 40 тестов прошли; если в роутере временно вернуть application: true, тест падает с "expected 101 to be less than or equal to 100" (роутер возвращён). bun run typecheck - 4/4 без ошибок. bunx biome check для изменённого файла - 0 ошибок.
- Ограничения: не выявлены.

What:
- The listBackupFiles test in __test__/backup/restore-security.test.ts now takes POSTGRES_MAX_FUNCTION_ARGS, maxJsonBuildArrayArgs and relationalQueryDb from the shared __test__/helpers/postgres-function-args.ts. The local counter copy and the drizzle.mock setup in the test are removed.
Why:
- The json_build_array argument counter existed twice: in this test and in the shared helper. The shared one also skips single-quoted strings.
Risks:
- None identified; only the test changes.
Checks:
- Commands and results: CI=true bunx vitest run --config __test__/vitest.config.ts __test__/backup/restore-security.test.ts - 40 tests passed; with application: true temporarily restored in the router, the test fails with "expected 101 to be less than or equal to 100" (the router was put back). bun run typecheck - 4/4 clean. bunx biome check on the changed file - 0 errors.
- Limitations: none identified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agentHits
agentHits merged commit aeb106b into AgentHits-Dev Oct 7, 2026
4 checks passed
@agentHits
agentHits deleted the test/backup-listing-shared-sql-helper branch October 7, 2026 03:48
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