Skip to content

Liquibase JPA slices each load a private configuration #317

Closed

Description

@fjlopez

What is wrong

These @DataJpaTest slices @ImportAutoConfiguration(LiquibaseAutoConfiguration.class) and keep the extra beans in a private nested @TestConfiguration. The nested class is part of the context key, so each slice runs the changelog on its own context. Gaps before the suite on the 2026-10-21 H2 run:

Class Gap Extra beans
ServiceCheckStoreTest 3.21s ServiceCheckStore
AffectedApplicationsTest 3.17s AffectedApplications, Replace.ANY
ServiceHealthFilterTest 1.91s ServiceHealthQuery
ServiceAccessSummaryTest 1.91s summary and usage beans
ServiceCheckDispatcherTest 1.13s sitmun.service-check.enabled=true

Two changelog tests are separate and should stay separate. They are slow because the assertion is a fresh H2 plus the master changelog.

  • ApplicationContactMigrationTest.migrationIsIdempotentAndColumnExists applies the changelog three times (11.748s).
  • SequenceMigrationTest.productionChangelogInitializesEveryTableGeneratorAboveSeededIds applies it once (7.278s).

Why this is not a test-only edit

Merging the nested imports changes which beans the slice loads. Sharing one migrated database across the changelog tests is a fixture change.

Empty nested @TestConfiguration classes that only imported I18nTestConfiguration are already hoisted to @Import on the test class. Do not reopen that.

Activity

  1. added
    plannedActive backlog; exempt from stale bot
    on Oct 21, 2026
  2. added theissue type on Oct 21, 2026
  3. fjlopez commented on Oct 21, 2026

    @fjlopez
    ContributorAuthor

    The empty i18n-only nested @TestConfiguration classes are hoisted in the local working tree on top of 73840f75. They are not on dev yet. Until that diff lands, HEAD still has the empty nested class, for example in TerritoryRepositoryTest.

    The five Liquibase slices in this issue still keep a private nested configuration with extra beans. That part is on dev and in the working tree.

    A later H2 run the same day, 08:04:19Z to 08:06:49Z, measured method time of 5.118s for ApplicationContactMigrationTest and 3.150s for SequenceMigrationTest. The issue's 11.748s and 7.278s are from the earlier run. Both tests still apply the master changelog. That apply stays.

    SequenceMigrationTest still does not check ATR_ID. That hole is #318. It does not change the decision to keep the changelog apply.

  4. fjlopez commented on Oct 21, 2026

    @fjlopez
    ContributorAuthor

    Fixed on dev by #350.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plannedActive backlog; exempt from stale bot

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions