test(c): isolate test_simple_api boxlite home from shared ~/.boxlite#616
test(c): isolate test_simple_api boxlite home from shared ~/.boxlite#616G4614 wants to merge 1 commit into
Conversation
098d535 to
792d76a
Compare
test_simple_api calls boxlite_simple_new, which uses BoxOptions::default() — home_dir resolves via default_home_dir() to ~/.boxlite, a shared, persistent, cross-version directory. A boxlite built with a newer DB schema leaves a forward-incompatible db there; an older-schema build then fails at box create with "Schema version mismatch" (migrations only go forward, so a newer db has no path back). The test was not hermetic — it depended on and was polluted by shared global state. On a persistent CI runner that keeps ~/.boxlite across runs, a schema bump can break later older-base PRs this way. The Simple API has no home parameter, so the only lever is BOXLITE_HOME. Run test_simple_api under a fresh per-invocation home — mktemp -d /tmp/boxlite-c-simple.XXXXXX, exported as BOXLITE_HOME and removed on exit — via a shell wrapper in add_test. Each run gets its own db, isolated from whatever other boxlite versions left on the machine, matching the /tmp temp -home convention the Rust/Python/Node/Go tests already use. Verified: make test:integration:c CTEST_FILTER="-R test_simple_api" → 9/9 sub-tests pass, 100%; the per-run /tmp home is cleaned up after. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
792d76a to
6924072
Compare
|
Scope note — why this is test-only, and the one user-facing exception:
The one user-facing path is a downgrade: running an older boxlite after a newer one has written |
set
BOXLITE_HOMEintest_simple_apiliketest_null_callback(dev only)