Skip to content

Shrink the two 1.4 MB test stub jars and document the test fixtures - #1550

Merged
stokpop merged 2 commits into
cloudfoundry:mainfrom
stokpop:stub-jars-and-testdata-readme
Nov 19, 2026
Merged

stokpop merged 2 commits into
cloudfoundry:mainfrom
stokpop:stub-jars-and-testdata-readme

Conversation

@stokpop

@stokpop stokpop commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Two spring-boot-3.0.0.jar fixtures (frameworks/auto_reconfiguration_servlet_3 and frameworks/java_cf_boot_3) were identical 1.4 MB copies of a real jar. Detection only matches the file name (spring-boot-3.*.jar, see java_cf_env.go), so they are now 324-byte manifest-only stubs, like the spring-core stub next to them. src/integration/testdata goes from 4.1 MB to 1.3 MB.

Also:

  • removes containers/dist_zip/lib/simple-http-server.jar.backup-java21: an earlier build of the same class that nothing references (git grep is empty), and the DistZip tests pass without it
  • adds src/integration/testdata/README.md: which fixtures are stubs, which are small hand-made apps, which are downloaded

Verified (Docker, cflinuxfs4, 5.1.2 zip): the 3 tests that use the stubs (Spring Auto-reconfiguration x2, Java CF Env) and the DistZip suite pass. Renaming a stub so its name no longer matches makes one of the 3 tests fail (3 mutations tried).

Replace duplicate 1.4 MB spring-boot-3.0.0.jar fixtures with empty stub jars
(detection only matches the file name), remove stray dist_zip backup jar, and
add testdata/README.md.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The README gives misleading fixture-maintenance guidance by overgeneralizing filename-only detection and listing source-only rejection fixtures as compiled apps.

2 open issues
What changed in this PR

This PR reduces integration-test fixture size by replacing two full Spring Boot jars with manifest-only stubs, removes an unused backup jar, and documents fixture maintenance.

Changes:

  • Replaces two 1.4 MB Spring Boot jars with 324-byte stubs used for filename-based detection.
  • Removes an unreferenced DistZip backup jar.
  • Adds documentation distinguishing structural stubs, small hand-made apps, and downloaded fixtures.
File Description
src/​integration/​testdata/​README.md Documents fixture categories, Spring stub requirements, and downloaded test applications.

Review effort: Balanced

Comment thread src/integration/testdata/README.md Resolved
Comment thread src/integration/testdata/README.md Resolved
Detection by file name only applies to the Spring dependency stubs: Java Main
reads Main-Class from manifests, so main and thin_jar_* need theirs. The
no_container_* source directories are negative detection cases, not apps.
@stokpop

stokpop commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, both comments were right and are fixed in 01247fc: the README now says that only the Spring dependency stubs are matched by file name (main and thin_jar_* need their META-INF/MANIFEST.MF because the Java Main container reads Main-Class from it), and the no_container_* source directories are listed as negative detection cases that must not be compiled.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the integration-fixture changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@stokpop
stokpop merged commit 0ac8e63 into cloudfoundry:main Nov 19, 2026
1 check passed
@stokpop
stokpop deleted the stub-jars-and-testdata-readme branch November 19, 2026 17:43
stokpop added a commit to stokpop/java-buildpack that referenced this pull request Nov 19, 2026
Resolve the conflicts with cloudfoundry#1550:
- frameworks/java_cf_boot_3: keep the deletion, the fixture is replaced by the real Spring Boot apps.
- testdata/README.md: merge both versions. Keep the sections about the downloaded real apps, and the stub notes of cloudfoundry#1550 (manifests, no_container_* cases, the 324 byte Spring stubs) that still apply.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants