Skip to content

Add unit tests for the site generator - #114

Open
wmdietl wants to merge 1 commit into
masterfrom
site-unit-tests
Open

wmdietl wants to merge 1 commit into
masterfrom
site-unit-tests

Conversation

@wmdietl

@wmdietl wmdietl commented Oct 10, 2026

Copy link
Copy Markdown
Member

Problem. The generator has no tests; the CI build (mvn -B package) only checks that it compiles. Its network-free helpers can regress unnoticed until a scheduled publish runs against the live site.

Fix. Add JUnit 5 (test scope) and pin maven-surefire-plugin, plus EisopSiteGeneratorTest covering:

  • getReadableDate on GitHub timestamps;
  • themeShippedPage: keeps only the body (case-insensitive tags), handles a page without <body>, and keeps the <!-- checker-framework-zip-version --> marker that the Checker Framework release scripts (release_utils.current_distribution_by_website) read from https://eisop.github.io/cf;
  • readTemplate: both templates are packaged, a missing one is an IOException;
  • substituteAfuPlaceholders: fills cf/index.md and every cf/<release>/index.md, leaves other files alone, is idempotent, and tolerates missing pages.

No change to the generator itself. The asset-name matching added in #112 (findZipAsset) is not covered here, to keep this PR independent of #112; a test for it can be added there or after it is merged.

Testing. mvn -B verify with JDK 21: 8 tests pass; spotless and sortpom leave the tree unchanged.

The generator had no tests, so the CI build only checked that it compiles.
Its helpers that do not need the network -- the date formatting, the
conversion of the release-shipped page into a Jekyll page, the lookup of
the packaged templates, and the filling in of the Annotation File
Utilities placeholders -- could regress unnoticed until a scheduled
publish ran against the live site.

Add JUnit 5 and tests for those helpers.  One test checks that the
version marker that the Checker Framework release scripts read from the
site survives the conversion of the shipped page.  Surefire is pinned so
that Renovate keeps it up to date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants