Test that scan refuses another schema version (closes #64) #82

Merged
clawbot merged 1 commits from issue-64-scan-schema-version-test into next 2026-10-04 13:30:24 +02:00
Collaborator

The version-mismatch test in db_test.go opened its database only through openReportDatabase, so the default: branch of initSchema (the one that stops scan on a database stamped with a schema version other than 0 and schemaVersion) could be deleted without any test failing.

The test now also opens the same database through openScanDatabase and requires errSchemaVersion. With the default: branch removed it fails on the scan check.

It is renamed from TestOpenReportDatabaseVersionMismatch to TestOpenDatabaseVersionMismatch, matching TestOpenDatabaseUnversionedForeign beside it, which already checks both the report and the scan path for the unversioned case added in #58.

No production code changes.

Model: opus-5-5

The version-mismatch test in `db_test.go` opened its database only through `openReportDatabase`, so the `default:` branch of `initSchema` (the one that stops `scan` on a database stamped with a schema version other than 0 and `schemaVersion`) could be deleted without any test failing. The test now also opens the same database through `openScanDatabase` and requires `errSchemaVersion`. With the `default:` branch removed it fails on the `scan` check. It is renamed from `TestOpenReportDatabaseVersionMismatch` to `TestOpenDatabaseVersionMismatch`, matching `TestOpenDatabaseUnversionedForeign` beside it, which already checks both the report and the scan path for the unversioned case added in https://git.eeqj.de/sneak/sfdupes/pulls/58. No production code changes. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 12:25:36 +02:00
clawbot self-assigned this 2026-10-04 12:25:36 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-04 13:01:42 +02:00
clawbot added 1 commit 2026-10-04 13:16:55 +02:00
The version-mismatch test only opened its database through
openReportDatabase, so nothing exercised the branch of initSchema that
stops scan on a database stamped with an unknown schema version. The
test now opens the same database through openScanDatabase too and
requires errSchemaVersion, and is renamed to match the unversioned-file
test beside it, which also covers both paths.

Model: opus-5-5
clawbot force-pushed issue-64-scan-schema-version-test from 9776984e19 to d68ba10071 2026-10-04 13:16:55 +02:00 Compare
Author
Collaborator

Rebased onto next; only the TODO.md entry conflicted.

Model: opus-5-5

Rebased onto `next`; only the `TODO.md` entry conflicted. Model: opus-5-5
clawbot added needs-review and removed needs-rebase labels 2026-10-04 13:16:58 +02:00
clawbot merged commit 8032ea682b into next 2026-10-04 13:30:24 +02:00
clawbot deleted branch issue-64-scan-schema-version-test 2026-10-04 13:30:25 +02:00
Sign in to join this conversation.