The tests are designed to start their own Solr (docker compose project with its own volume), so they should never touch a dev site's data. However, the test containers bind the fixed host port 8983 — the same port a locally running site Solr uses — so the tests either clobber the site's index (their fixtures clear and rewrite it; healed only by a make solr-activate-and-reindex) or cannot start at all. This must be prevented outright: the test Solr must never coincide with a site Solr.
Solution: parameterize the compose host-port mappings (${SOLR_ACCEPTANCE_PORT:-8983}:8983) and have pytest set them to 0, so every test session gets ephemeral host ports; the Plone test fixture points collective.solr.port at the dynamic port. Manual/acceptance use keeps the fixed defaults. As a bonus, a dev site and the test suite can run at the same time.
Verification: with a site Solr running on 8983 holding a marker document, the suite runs on an ephemeral port and the marker survives untouched.
(Split out of #81, which now covers the runtime regression.)
The tests are designed to start their own Solr (docker compose project with its own volume), so they should never touch a dev site's data. However, the test containers bind the fixed host port 8983 — the same port a locally running site Solr uses — so the tests either clobber the site's index (their fixtures clear and rewrite it; healed only by a
make solr-activate-and-reindex) or cannot start at all. This must be prevented outright: the test Solr must never coincide with a site Solr.Solution: parameterize the compose host-port mappings (
${SOLR_ACCEPTANCE_PORT:-8983}:8983) and have pytest set them to0, so every test session gets ephemeral host ports; the Plone test fixture pointscollective.solr.portat the dynamic port. Manual/acceptance use keeps the fixed defaults. As a bonus, a dev site and the test suite can run at the same time.Verification: with a site Solr running on 8983 holding a marker document, the suite runs on an ephemeral port and the marker survives untouched.
(Split out of #81, which now covers the runtime regression.)