Skip to content

chore: run tests by default in Maven builds - #1228

Open
GOODBOY008 wants to merge 1 commit into
apache:mainfrom
GOODBOY008:build/run-tests-by-default
Open

GOODBOY008 wants to merge 1 commit into
apache:mainfrom
GOODBOY008:build/run-tests-by-default

Conversation

@GOODBOY008

Copy link
Copy Markdown
Member

Motivation

<maven.test.skip>true</maven.test.skip> has been a POM default ever since the EasyExcel import (f7d8ceb). This inverts standard Maven behavior and made -DskipTests a no-op (maven.test.skip takes precedence in both the compiler and Surefire):

Command Before After
mvn clean install tests neither compiled nor run tests compiled and run
mvn clean install -DskipTests no-op — tests still skipped standard: compile tests, skip execution
mvn clean install -Dmaven.test.skip=false the only way to run tests no longer needed

This deviates from ASF practice:

  • The Apache parent POM defines no test-skip defaults; projects inherit Maven's default lifecycle where the test phase runs.
  • Sibling projects (POI, Commons, Maven core) all run tests by default; the only same-default upstream is alibaba/easyexcel.
  • Surefire's Skipping Tests page positions maven.test.skip as a last-resort CLI escape hatch ("If you absolutely must"), not a POM default.
  • Our own docs were misleading: the contributor guide suggested -DskipTests "to skip unit tests" and the release vote templates asked voters to build with -DskipTests, although the ASF Release Policy requires voters to "compile as provided, and test the result".

Why now (history: #390 → #392)

#390 flipped this default once (2025-06) and #392 reverted it the same day because CI took 2–5 hours. Both causes are gone:

  1. With tests enabled at the POM level, the install CI step back then re-ran the whole suite a second time (its core/** scope limit did not exclude the large-file tests — large/ lives under core/). This PR keeps that step on -DskipTests, so the suite runs exactly once per JDK job, same as today.
  2. The historical test weight has shrunk on its own: measured from 2026-10-15 CI logs, the full suite (1051 tests then, 1085 now) takes ~2.5 min per JDK job; LargeDataTest including the 74 MB large07.xlsx now runs in 89 s. Multi-hour CI durations these days are runner queueing, not test execution (one 236-min run broke down as 232 min queued / 2–3 min executing).

Changes

  • pom.xml: drop the maven.test.skip default.
  • .github/workflows/ci.yml: the test step no longer passes -Dmaven.test.skip=false (tests run by default); the follow-up full-reactor install step now passes -DskipTests so the suite does not run twice.
  • .github/workflows/nightly.yml, .github/workflows/fuzz-tests.yml: drop the now-redundant flag.
  • .github/copilot-instructions.md: update the build/test commands.
  • Website docs (en + zh-cn): mvn clean install is documented as the primary build command; the release deploy command and vote templates no longer skip tests.

Verification

  • ./mvnw clean package -pl fesod-common,fesod-shaded,fesod-sheet (no flags): 1085 tests run, 0 failures, BUILD SUCCESS in 1:16 (JDK 17) — tests now run by default.
  • ./mvnw clean package -pl fesod-common -DskipTests: "Tests are skipped." — standard flag semantics restored.
  • ./mvnw spotless:check: clean.
  • Net CI work is unchanged: the PR test matrix executes the same suite it already ran via the explicit flag.

Note for reviewers: #1227 moves .github/copilot-instructions.md to the root as AGENTS.md; that PR will need a trivial rebase after this one merges.

Drop the maven.test.skip=true POM default inherited from EasyExcel so
the build follows the standard Maven/Apache convention: mvn install
compiles and runs tests, and -DskipTests skips execution only (before,
-DskipTests was a no-op because maven.test.skip took precedence).

The Apache parent POM sets no test-skip defaults and sibling projects
(POI, Commons, Maven core) all run tests by default. This also fixes
misleading docs: the contributor guide and release vote templates
referenced -DskipTests with inverted semantics.

CI keeps its current shape: the test step runs the same suite it ran
via the explicit -Dmaven.test.skip=false flag, and the follow-up full
reactor install step gets -DskipTests so the suite does not run twice
(the failure mode that got apache#390 reverted by apache#392 in 2025). The full
suite is ~2.5 min per JDK job on current runners, so this no longer
carries the CI cost it did then.

Signed-off-by: gongzhongqiang <gongzhongqiang@apache.org>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 04:10

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.

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