|
9 | 9 | # It works by: |
10 | 10 | # (1) Finding the previous release (the latest GitHub release) and its published |
11 | 11 | # circ-webapp image. |
12 | | -# (2) Confirming that image contains the external-schema test seam. The seam ships in a |
13 | | -# later release than this check itself, so until a release that has it becomes the |
14 | | -# previous release there is nothing to test and we skip. |
15 | | -# (3) Initializing a fresh database with the CURRENT image, which builds the new schema. |
16 | | -# (4) Running the previous release's database tests (pytest -m db) against that schema in |
| 12 | +# (2) Initializing a fresh database with the CURRENT image, which builds the new schema. |
| 13 | +# (3) Running the previous release's database tests (pytest -m db) against that schema in |
17 | 14 | # external-schema mode (PALACE_TEST_DATABASE_EXTERNAL_SCHEMA), so the older code |
18 | 15 | # exercises the new schema. If those tests fail, the migration is not backwards |
19 | 16 | # compatible. |
|
71 | 68 |
|
72 | 69 | trap cleanup EXIT |
73 | 70 |
|
74 | | -# (2) Make sure the previous release actually includes the external-schema test seam. It |
75 | | -# ships in a later release than this check, so older images do not support it yet and there |
76 | | -# is nothing meaningful to test. |
77 | | -compose_cmd pull --quiet webapp-prev || fail "Could not pull ${PREV_RELEASE_IMAGE}." |
78 | | -if ! run_in_container webapp-prev "grep -q 'external_schema' tests/fixtures/database.py"; then |
79 | | - echo "Previous release image does not include the external-schema test seam; skipping." |
80 | | - exit 0 |
81 | | -fi |
82 | | - |
83 | | -# (3) Build the current schema by initializing a fresh database with the current image. |
| 71 | +# (2) Build the current schema by initializing a fresh database with the current image. |
84 | 72 | compose_cmd up -d pg os minio redis || fail "Could not start service containers." |
85 | 73 | run_in_container webapp "./bin/util/initialize_instance" \ |
86 | 74 | || fail "Failed to initialize the database with the current image." |
87 | 75 |
|
88 | | -# (4) Run the previous release's database tests against the new schema. -n0 forces serial |
| 76 | +# (3) Run the previous release's database tests against the new schema. -n0 forces serial |
89 | 77 | # execution, which external-schema mode requires (all tests share the one database). |
| 78 | +compose_cmd pull --quiet webapp-prev || fail "Could not pull ${PREV_RELEASE_IMAGE}." |
90 | 79 | echo "Running the previous release's database tests against the current schema ..." |
91 | 80 | if ! run_in_container webapp-prev \ |
92 | 81 | "uv sync --frozen --active && pytest --no-cov -n0 -m db --ignore=tests/migration tests"; then |
|
0 commit comments