E2E: Cover House Tables against a deployed MySQL - #698
Draft
ruolin59 wants to merge 1 commit into
Draft
Conversation
The suite in services/housetables drives the slice through MockMvc on H2. That leaves untested the parts which only exist in a deployment: the JSON a caller actually receives, the exception advice that has to survive persistence wrapping, and the discriminator column as MySQL stores it. These tests drive the running service over HTTP. Where the REST API cannot express the state under test they plant rows with SQL, since no endpoint writes a legacy NULL discriminator or a corrupt one. Those tests skip when no database is reachable rather than fail, so the suite still runs against a deployment whose database is not exposed. CI moves from the oh-only recipe to a MySQL-backed variant of it. That costs one container per run and changes what the existing integration test runs against. oh-only itself is untouched, so the IN_MEMORY path keeps its coverage. The recipe mounts services/housetables/ddl as the database's init directory, so every run also checks that the recorded DDL is a working migration path, which nothing else does today. The fixed sleep before the tests becomes a readiness poll, because MySQL starts more slowly and less predictably than H2. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ruolin59
force-pushed
the
rufan/hts-deployment-tests
branch
from
August 28, 2026 00:43
003d58b to
94bb668
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #697. Base is
rufan/views-hts-lifecycle, so this diff is only the deployment-test work.What this is
services/housetablestests the slice through MockMvc against H2. Three things only exist in a deployment and were therefore untested:ResponseEntitya handler returnsentity_typeas MySQL stores and compares it, not as H2's MySQL-compatibility mode does23 tests, run over HTTP against a running service.
Two defects on #697 were found this way and are already fixed there: the unreachable
CorruptEntityTypeExceptionhandler (fcf243ce) and the collation assumption inEntityType.fromName(a8aa8fd0). Neither was visible to the MockMvc suite — the first because the status was 500 by accident through the catch-all, so a status-only assertion passed while the handler was dead.Please look hardest at these
1. CI switches recipe.
.github/workflows/build-run-tests.ymlmoves fromoh-onlytooh-only-mysql. Every run now starts a MySQL container, and the existingintegration_test.pyruns against MySQL rather than H2. That is a change to an existing pipeline, not just an added step.oh-onlyitself is untouched, so the IN_MEMORY path keeps its coverage — but nothing in CI exercises it any more.2.
sleep 30becomes a readiness poll. Justified — a MySQL start is slower and less predictable — but it changes the existing pipeline's timing behaviour and is not strictly required by the new tests.3. The recipe mounts
services/housetables/ddlas the MySQL init directory. Side effect: every run checks the recorded DDL is a working migration path, which nothing else does. But that directory came from BDP-108403, not this ticket, and its file convention is still under review there (it differs fromscripts/housetables-migrations/inli-openhouse). This couples CI to a layout that may yet change.4. Scope. The original brief was a test script plus a CI step. It grew a compose recipe, a
SETUP.mdrow and a dependency. Each is defensible on its own; the total is worth a deliberate yes or no.Skips, not failures
Tests needing SQL — planting a legacy
NULLdiscriminator, or a corrupt one, which no endpoint can write — skip when no database is reachable, and skips are reported separately from passes. Against the MySQL recipe: 23 passed, 0 skipped. With the database unreachable: 20 passed, 3 skipped.The endpoint-agreement invariant
The most durable assertion here. For any key,
/hts/entitiesand the matching typed read must agree on whether the row exists. It is collation-robust where per-row status assertions are not: under PAD SPACE a trailing-space discriminator compares equal toTABLEand both routes answer 200; under NO PAD they disagree and the assertion fails, naming the right bug.It does not hold universally on this deployment, and the test does not pretend otherwise. A corrupt discriminator genuinely breaks it — the typed route's predicate misses the row while the neutral route has no predicate and hydrates it into the converter. That is asserted as an explicit known-bad disagreement, so a future fix fails loudly instead of leaving a stale assertion.
Not verified
The production collation for
user_table_row.entity_type. Measurements here are against MySQL 8.4utf8mb4_0900_ai_ci(NO PAD);ddl/0000__baseline.sqlspecifies none. Same open question as on #697.That matters for anyone re-running this suite: several corrupt-value assertions are collation-dependent, and the 404-vs-500 split on a trailing-space discriminator inverts under PAD SPACE. Against a differently-collated MySQL those are environment failures, not regressions. The endpoint-agreement assertions hold either way.