From bc574cdbdab3cf76dc21ab58fc5c70c178aec711 Mon Sep 17 00:00:00 2001 From: gongzhongqiang Date: Fri, 16 Oct 2026 12:10:14 +0800 Subject: [PATCH] chore: run tests by default in Maven builds 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 #390 reverted by #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 --- .github/copilot-instructions.md | 9 ++++++--- .github/workflows/ci.yml | 5 +++-- .github/workflows/fuzz-tests.yml | 4 ++-- .github/workflows/nightly.yml | 2 +- pom.xml | 1 - website/community/contribution/contribute-code.md | 4 ++-- website/community/release/release-version.md | 6 +++--- .../current/contribution/contribute-code.md | 4 ++-- .../current/release/release-version.md | 6 +++--- 9 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d642d931e..786558785 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -11,11 +11,14 @@ Apache Fesod (Incubating) is a Java library for processing spreadsheets (XLS/XLS ## Build & Test Commands ```bash -# Build (skips tests by default) +# Build (runs tests by default, per Maven/Apache convention) +./mvnw clean install + +# Fast build without running tests ./mvnw clean install -DskipTests -# Run tests (must explicitly enable) -./mvnw clean package -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet +# Run tests for the library modules only +./mvnw clean package -pl fesod-common,fesod-shaded,fesod-sheet # Format check / auto-format ./mvnw spotless:check diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba306012c..8213ab4b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,13 +86,14 @@ jobs: restore-keys: | ${{ runner.os }}-m2 - name: Test with Maven - run: ./mvnw clean package -B -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet + run: ./mvnw clean package -B -pl fesod-common,fesod-shaded,fesod-sheet - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: (!cancelled()) with: files: "**/target/surefire-reports/*.xml" - name: Maven Build - run: ./mvnw install -B -V + # Tests already ran in the previous step; skip here to avoid a second full run + run: ./mvnw install -B -V -DskipTests - name: Java Doc run: ./mvnw javadoc:javadoc diff --git a/.github/workflows/fuzz-tests.yml b/.github/workflows/fuzz-tests.yml index b05591cfb..18eebac68 100644 --- a/.github/workflows/fuzz-tests.yml +++ b/.github/workflows/fuzz-tests.yml @@ -49,8 +49,8 @@ jobs: JAZZER_ARGS: "-artifact_prefix=${{ runner.temp }}/jazzer-artifacts/ -max_total_time=300 -rss_limit_mb=2048" run: | mkdir -p "${{ runner.temp }}/jazzer-artifacts/" - # Execute only tests under fuzz package and force tests not to be skipped - mvn -B -pl fesod-sheet -am -D"maven.test.skip=false" -DtrimStackTrace=false -D"test=org.apache.fesod.sheet.fuzz.*Test" -D"surefire.failIfNoSpecifiedTests=false" package + # Execute only tests under the fuzz package; tests run by default in Maven builds + mvn -B -pl fesod-sheet -am -DtrimStackTrace=false -D"test=org.apache.fesod.sheet.fuzz.*Test" -D"surefire.failIfNoSpecifiedTests=false" package - name: Upload Jazzer artifacts (crashes, repros) if: always() diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c66dab231..622e6325f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -49,7 +49,7 @@ jobs: restore-keys: | ${{ runner.os }}-m2 - name: Test with Maven - run: ./mvnw clean install -B -V -Dmaven.test.skip=false + run: ./mvnw clean install -B -V - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: (!cancelled()) diff --git a/pom.xml b/pom.xml index a91c9dd46..4afa0c1a4 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,6 @@ under the License. 3.14.1 3.5.4 true - true 4.5.0 1.14.1 3.18.0 diff --git a/website/community/contribution/contribute-code.md b/website/community/contribution/contribute-code.md index 9955a6186..9ad8bb77a 100644 --- a/website/community/contribution/contribute-code.md +++ b/website/community/contribution/contribute-code.md @@ -115,10 +115,10 @@ When submitting a PR, please ensure that the changes are based on the `main` bra ## Compile -Run the following command to compile +Run the following command to compile (unit tests run by default) ```bash -mvn clean install -DskipTests +mvn clean install ``` To speed up the build process, you can: diff --git a/website/community/release/release-version.md b/website/community/release/release-version.md index 3b6911572..d5a3520fe 100644 --- a/website/community/release/release-version.md +++ b/website/community/release/release-version.md @@ -344,7 +344,7 @@ mvn versions:set-property -Dproperty=project.build.outputTimestamp -DnewVersion= Compile the source code of the pre-release RC branch and push the binary packages to the [staging repository](https://repository.apache.org/#stagingRepositories). ```bash -mvn clean deploy -Papache-release -DskipTests -Dgpg.skip=false +mvn clean deploy -Papache-release -Dgpg.skip=false ``` Log in to the ASF Nexus repository with your Apache ID, locate the released version, and click **Close**. @@ -476,7 +476,7 @@ which can be found in the keys file: https://downloads.apache.org/incubator/fesod/KEYS Build Environment: JDK 8+, Apache Maven 3.6.0+. -./mvnw clean package -DskipTests +./mvnw clean package The vote will be open for at least 72 hours. @@ -608,7 +608,7 @@ to [ xxxx@apache.org ] which can be found in the keys file: https://downloads.apache.org/incubator/fesod/KEYS Build Environment: JDK 8+, Apache Maven 3.6.0+. -./mvnw clean package -DskipTests +./mvnw clean package The vote will be open for at least 72 hours. diff --git a/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/contribution/contribute-code.md b/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/contribution/contribute-code.md index 8d0494751..3a6273284 100644 --- a/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/contribution/contribute-code.md +++ b/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/contribution/contribute-code.md @@ -117,10 +117,10 @@ git push origin ## 编译 -运行以下命令编译 +运行以下命令编译(默认会运行单元测试) ```bash -mvn clean install -DskipTests +mvn clean install ``` 为了加快构建速度,您可以: diff --git a/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/release/release-version.md b/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/release/release-version.md index 830dac2b6..40677a82f 100644 --- a/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/release/release-version.md +++ b/website/i18n/zh-cn/docusaurus-plugin-content-docs-community/current/release/release-version.md @@ -344,7 +344,7 @@ mvn versions:set-property -Dproperty=project.build.outputTimestamp -DnewVersion= 编译预发布RC版本分支源码,并推送二进制包到 [预发仓库](https://repository.apache.org/#stagingRepositories) ```bash -mvn clean deploy -Papache-release -DskipTests -Dgpg.skip=false +mvn clean deploy -Papache-release -Dgpg.skip=false ``` 使用 Apache ID 登录 ASF Nexus 仓库,找到发布的版本并点击 **Close**。 @@ -476,7 +476,7 @@ which can be found in the keys file: https://downloads.apache.org/incubator/fesod/KEYS Build Environment: JDK 8+, Apache Maven 3.6.0+. -./mvnw clean package -DskipTests +./mvnw clean package The vote will be open for at least 72 hours. @@ -608,7 +608,7 @@ to [ xxxx@apache.org ] which can be found in the keys file: https://downloads.apache.org/incubator/fesod/KEYS Build Environment: JDK 8+, Apache Maven 3.6.0+. -./mvnw clean package -DskipTests +./mvnw clean package The vote will be open for at least 72 hours.