Repository navigation
test(api): fail loudly when the SPA bundle is missing - #100
Merged
Merged
Conversation
SpaRoutingHttpTests was @EnabledIf("spaEntryPresent") over
static/admin/admin.html, a bundle that is not committed and that only the
frontend profile generates. A worktree without it skipped the whole class and
the suite stayed green while covering less than it claimed: JUnit counts a
disabled container as one placeholder per method, so the report said "4
skipped" while the 20 @ParameterizedTest cases were never expanded and 21
executions were silently lost.
A @BeforeAll now fails with the reason and the two commands that build the
bundle, instead of skipping. Verified both ways with the same command: with the
bundle, 21 run and the build succeeds; in a copy with the bundle removed, the
class fails with IllegalStateException at requireSpaBundle and the build fails.
The cost is deliberate and documented: a local mvn verify without -Pfrontend
now fails. CI always builds the bundle, so it is unaffected.
This was referenced Nov 1, 2026
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.
Issue relacionada
Sin issue vinculada, a propósito. Es el follow-up directo de un hallazgo medido durante el PR #98: el conteo de tests de este repo dependía del entorno de una forma invisible. No hay issue abierta que describa el problema, y no referencio una ajena para no cerrarla de rebote.
El problema, con números: sin el bundle del frontend,
SpaRoutingHttpTestsse salteaba entera y el reporte decía 4 skipped, mientras en realidad se perdían 21 ejecuciones (1@Test+ 20 casos de tres@ParameterizedTest). JUnit cuenta un contenedor deshabilitado como un placeholder por método, así que el agujero de cobertura se veía cuatro veces más chico de lo que era — y la suite quedaba verde igual.Tipo de PR
type:chore) — sólo un test y un documento. Sin cambios de producción.Resumen
@EnabledIf("spaEntryPresent")sale deSpaRoutingHttpTests; entra un@BeforeAllque falla explícito si faltastatic/admin/admin.html, con un mensaje que dice exactamente qué correr para construir el bundle.mvn verifylocal sin-Pfrontendahora falla en vez de pasar con skips. El CI no se ve afectado porque siempre construye el bundle.Cambios
api/src/test/java/com/carrito/saas/SpaRoutingHttpTests.java@EnabledIf; entrarequireSpaBundle()(@BeforeAll) conIllegalStateExceptiony mensaje accionable. Javadoc actualizado: explicaba el skip, ahora explica por qué noodd/tasks/cross-tenant-followups.mddevelop; sección de entrega actualizada con el merge de #98 (6fedb18)Plan de pruebas
Los dos lados, con el mismo comando (
-Dtest=SpaRoutingHttpTests):Tests run: 21, BUILD SUCCESSTests run: 21, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESSTests run: 4, Skipped: 4, BUILD SUCCESS (exit 0)Tests run: 1, Errors: 1, BUILD FAILURE (exit 1)Lado que falla, literal:
El escenario "sin bundle" se corrió en una copia throwaway en
/tmpcon eladmin.htmlborrado; el árbol real nunca se tocó. El escenario "con bundle" es el árbol real con el bundle construido por-Pfrontend.mvn -B --no-transfer-progress -Pfrontend verify(el comando deci.yml), que construye el bundle y por eso pasa.Checklist
ci.ymlno tiene gate de issuetype:*(type:chore)Co-Authored-Byodd/tasks/cross-tenant-followups.mdL7