Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Upload test reports and coverage #163

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

advancedxy
Copy link
Contributor

Which issue does this PR close?

Partially closes #120

Rationale for this change

Upload test reports and test coverage reports so that it could be accessed after workflow runs.

What changes are included in this PR?

  1. refactor MAVEN_OPTS to maven_opts which is more consistent with others
  2. add jacoco plugin to generate test coverage for both Java and Scala test
  3. Upload test reports and test coverage reports for Ubuntu-Java17-Spark-3.4 combination.

How are these changes tested?

existing CI runs.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@advancedxy
Copy link
Contributor Author

cc @sunchao

@advancedxy
Copy link
Contributor Author

Test coverage for rust is not included in this PR. Maybe we can enable that later or not since there's not that much unit test code in the rust side..

We may have to find a way to generate rust coverage from Spark side's tests.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @advancedxy !

@sunchao
Copy link
Member

sunchao commented Mar 4, 2024

We may have to find a way to generate rust coverage from Spark side's tests.

I think we can use cargo2junit for this. Example:

cargo test --release --color=never -- --color=never -Zunstable-options --report-time --format json | cargo2junit > target/cargo-reports/TEST-all.xml

cc @snmvaughan

@sunchao
Copy link
Member

sunchao commented Mar 4, 2024

There are some merge conflicts. Please try to rebase this @advancedxy and I'll merge it afterwards.

@advancedxy
Copy link
Contributor Author

advancedxy commented Mar 5, 2024

I think we can use cargo2junit for this. Example:

There's also other coverage tool for rust, for example: arrow-rs uses tarpaulin in https://github.com/apache/arrow-rs/blob/master/.github/workflows/coverage.yml. We can leverage it too.

What I mean was since most of the test code are written in Spark's side, it would be ideal that after running tests on the JVM/Spark side, the test coverage for the native comet lib is generated automatically.

@sunchao
Copy link
Member

sunchao commented Mar 5, 2024

What I mean was since most of the test code are written in Spark's side, it would be ideal that after running tests on the JVM/Spark side, the test coverage for the native comet lib is generated automatically.

I see what you mean. Not sure whether this is possible.

@sunchao sunchao merged commit 56ccf6a into apache:main Mar 5, 2024
19 checks passed
@sunchao
Copy link
Member

sunchao commented Mar 5, 2024

Merged, thanks!

@advancedxy
Copy link
Contributor Author

Not sure whether this is possible.

It might be possible, see https://stackoverflow.com/questions/70410715/how-to-collect-rust-code-coverage-when-running-remote-tests and https://rustc-dev-guide.rust-lang.org/llvm-coverage-instrumentation.html for related approaches. But I think it's in a low priority and we can always evaluate that when needed.

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.

Add test reporter and (optionally) code coverage tool
3 participants