test(build): add no-poi Maven profile to validate poi-ooxml stays optional (I1)#91
Merged
Merged
Conversation
…ional (I1) Wires up Track I1 from the readiness taskboard. poi-ooxml is declared optional in pom.xml; this PR adds the regression gate that proves the rest of the canonical suite runs without it. Profile: -P no-poi excludes poi-ooxml + poi + poi-ooxml-lite from surefire classpath via classpathDependencyExcludes and sets no.poi=true system property. DocxSemanticBackendTest (whole class) and DocumentSessionTest#semanticBackendsShouldExportManifestsFromDocumentGraph carry @DisabledIfSystemProperty so they skip cleanly. New no-poi-suite CI job runs the profile on every PR. Local run: 1029 tests, 0 failures, 4 skipped under -P no-poi.
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.
Summary
Wires up Track I1 from the v1.6.5→1.7 readiness taskboard.
poi-ooxmlis declared<optional>true</optional>inpom.xmlso callers that render only PDFs don't pay the ~10 MB POI footprint; this PR ships the regression gate that proves the rest of the canonical suite runs without it.What changes
no-poiprofile inpom.xmlActivates a profile that does two things via
maven-surefire-plugin:<classpathDependencyExcludes>:org.apache.poi:poi-ooxml,org.apache.poi:poi,org.apache.poi:poi-ooxml-lite. No POI on the classpath at test runtime — any unconditional reference becomesNoClassDefFoundError.no.poi=truesystem property so DOCX-specific tests can self-skip.Two tests carry
@DisabledIfSystemProperty(named = "no.poi", matches = "true")DocxSemanticBackendTest(whole class)org.apache.poi.xwpf.usermodel.*and exercisesDocxSemanticBackendend-to-end.DocumentSessionTest#semanticBackendsShouldExportManifestsFromDocumentGraphsession.export(new DocxSemanticBackend())produces a ZIP-shaped DOCX byte stream.Both skip cleanly under
-P no-poi. All other tests — including the rest ofDocumentSessionTest— run green without POI on the classpath.New CI job —
no-poi-suitePR-only, runs after the architecture guards job, executes
./mvnw -B -ntp test -pl . -P no-poi. Adds the regression gate to every PR so a future change that quietly introduces an unconditional POI reference fails the job rather than silently re-coupling the optional dependency.Verification
4 skipped ==
DocxSemanticBackendTest(3 tests) + 1 method inDocumentSessionTest— exactly the methods I annotated. The other 1025 tests ran without POI on the classpath, validating the<optional>declaration.CHANGELOG entry added to
v1.6.6 — Plannedunder the### Buildsubsection.Why this scope
poi-ooxmlstays a declared dependency so consumers that do need DOCX still resolve it transitively; the profile is for us to test the no-POI footprint.DocxSemanticBackend.javaitself is untouched. The taskboard says "DOCX backend disabled gracefully"; gracefully here means "the suite around it doesn't fall over when POI is absent", which is what this validates.Test plan
-P no-poiprofile green locally (1029 / 0 / 0 / 4 skipped)binary-compatprofile unchanged (still in the same<profiles>block)no-poi-suitejob@DisabledIfSystemPropertyplacements are the load-bearing piecesgraphcomposewithout explicitly addingpoi-ooxml— tracked as v1.6.6 release-prep checklist item