Class MassIndexerSmokeIntegrationTest


@Disabled("Step 6: destructive against gemma.search.dir + gemdtest; invoke manually for cutover validation. See class Javadoc and SEARCH_INDEX_OPERATIONS.md.") public class MassIndexerSmokeIntegrationTest extends BaseSpringContextTest5
End-to-end smoke test for the Hibernate Search 7 mass-indexer + search service round-trip (SEARCH_RECCE.md Step 6).

What this test does, in order:

  1. Boots the full Gemma Spring context (DB = gemdtest, full HS 7 wiring).
  2. Persists two fixtures with known, unique tokens — one ExpressionExperiment and one Gene. The tokens are random alphanumerics seeded per-test so the assertions can be precise even when the test DB carries leftover state from prior runs.
  3. Triggers the IndexerService mass-indexer for each fixture's entity root. purgeAllOnStart(true) wipes the on-disk Lucene index before rebuilding — which is destructive against the shared gemma.search.dir. See the gemdtest-serialization caveat in this class's Javadoc.
  4. Issues a SearchService.search(SearchSettings, SearchContext) with a SearchSettings carrying the known token, asserts non-empty results, and asserts the fixture is in the hit list.
  5. Cleans up the persisted fixtures so subsequent test runs start clean.

Why @Disabled by default. This IT is destructive against the shared Lucene index directory (gemma.search.dir) and the gemdtest database (writes + deletes EE/Gene rows). Parallel Gemma sub-agents serialize against gemdtest per the project's parallel-agent gotchas, and the mass-indexer holds the index directory for the duration of the rebuild. Running this opportunistically in CI alongside other integration tests would either corrupt search results for those tests or fight them for the index. Operators should invoke this IT manually as part of the Step-6 cutover validation:

mvn -pl gemma-core failsafe:integration-test \
    -Dit.test=MassIndexerSmokeIntegrationTest \
    -DfailIfNoTests=false

The @Tag("integration") inherited from BaseSpringContextTest5BaseIntegrationTest5 ensures this class is routed to Failsafe (i.e. mvn verify), not Surefire (mvn test), independent of the @Ignore.

See SEARCH_INDEX_OPERATIONS.md for the production reindex procedure that this IT smoke-tests.

Author:
Phase 3 search restoration, Step 6
  • Constructor Details

    • MassIndexerSmokeIntegrationTest

      public MassIndexerSmokeIntegrationTest()
  • Method Details

    • tearDown

      @AfterEach public void tearDown()
    • massIndexerRebuildMakesFixturesSearchable

      @Test public void massIndexerRebuildMakesFixturesSearchable() throws Exception
      Throws:
      Exception