Skip to content

Tests: one script for the test DB init, used by CI and TESTS.md (stacked on #2964) - #2972

Open
atalyaalon wants to merge 1 commit into
claude/gallant-archimedes-nwlpaofrom
claude/laughing-galileo-165xk1-test-init-script
Open

atalyaalon wants to merge 1 commit into
claude/gallant-archimedes-nwlpaofrom
claude/laughing-galileo-165xk1-test-init-script

Conversation

@atalyaalon

@atalyaalon atalyaalon commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The test-DB setup (the migrations plus 6 data loads) lived in two places, .github/workflows/Tests.yml and docs/TESTS.md, and they had drifted apart: the old TESTS.md only loaded registered-vehicles and cbs. @ziv17 asked about exactly this on #2964.

Change

  • New bin/init_test_db.sh CONTAINER: the single source of the test-DB init.
    • It runs alembic upgrade head, then cities, streets, registered-vehicles, cbs --source local_dir_for_tests_only, road-segments and junctions.
    • It uses set -euo pipefail, so it stops at the first error, and it prints each step.
  • Tests.yml: bin/init_test_db.sh anyway. The steps and their order are unchanged.
  • docs/TESTS.md: bin/init_test_db.sh anyway-tests. The clean-start note from Upgrade DB images to PostgreSQL 18 / PostGIS 3.7 + upgrade runbook #2964 (docker compose -f docker-compose-tests.yml down -v) is kept.

Stacked on #2964

Testing

https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV


Generated by Claude Code

bin/init_test_db.sh CONTAINER runs the migrations and the 6 data loads. CI
(Tests.yml, container anyway) and docs/TESTS.md (anyway-tests) both call it,
so the two can't drift apart again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV

@ziv17 ziv17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

This branch has not been deployed

No deployments
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.

3 participants