[KYUUBI #5837] [INFRA] Only enable Jacoco with explicit profile

# 🔍 Description
## Issue References 🔗

Currently, we always enable Jacoco, which would add additional building time and produce lots of HTML files, also increase the IDEA indexing burden.

<img width="1065" alt="image" src="https://github.com/apache/kyuubi/assets/26535726/6276f309-8ba4-4563-96d6-91cb53ce20a5">

## Describe Your Solution 🔧

Add a new maven profile `codecov`, only enable it in CI with codecov enabled.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

See CI result.

---

# Checklists
## 📝 Author Self Checklist

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [x] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [x] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes #5837 from pan3793/codecov.

Closes #5837

97d0b22de [Cheng Pan] fi
c60367dd1 [Cheng Pan] fix
a0e8910bc [Cheng Pan] Only enable Jacoco with explicit profile

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
Cheng Pan 2023-12-10 23:58:59 +08:00
parent 04f3fb0c54
commit ffcee97afe
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
3 changed files with 41 additions and 25 deletions

View File

@ -106,6 +106,9 @@ jobs:
python-version: '3.9'
- name: Build and test Kyuubi and Spark with maven w/o linters
run: |
if [[ "${{ matrix.java }}" == "8" && "${{ matrix.spark }}" == "3.4" && "${{ matrix.spark-archive }}" == "" ]]; then
MVN_OPT="${MVN_OPT} -Pcodecov"
fi
TEST_MODULES="dev/kyuubi-codecov"
./build/mvn clean install ${MVN_OPT} -pl ${TEST_MODULES} -am \
-Pjava-${{ matrix.java }} -Pspark-${{ matrix.spark }} -Pspark-authz-hudi-test ${{ matrix.spark-archive }} ${{ matrix.exclude-tags }}

View File

@ -142,26 +142,6 @@
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-agg</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
<configuration>
<dataFileIncludes>
<dataFileInclude>**/jacoco*.exec</dataFileInclude>
</dataFileIncludes>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate-all</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@ -241,5 +221,31 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>codecov</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-agg</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
<configuration>
<dataFileIncludes>
<dataFileInclude>**/jacoco*.exec</dataFileInclude>
</dataFileIncludes>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate-all</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

17
pom.xml
View File

@ -2058,11 +2058,6 @@
<artifactId>spotless-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@ -2426,6 +2421,18 @@
</properties>
</profile>
<profile>
<id>codecov</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>apache-release</id>
<build>