You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2023/01/18 08:41:00 UTC

[jira] [Created] (IMPALA-11848) Add build option to generate code coverage report after running tests

Quanlong Huang created IMPALA-11848:
---------------------------------------

             Summary: Add build option to generate code coverage report after running tests
                 Key: IMPALA-11848
                 URL: https://issues.apache.org/jira/browse/IMPALA-11848
             Project: IMPALA
          Issue Type: Task
          Components: Infrastructure
            Reporter: Quanlong Huang


We need an option in buildall.sh to generate code coverage reports after running the tests. So we can integrate it with Jenkins to get regular code coverage reports. Some background about existing works:

h4. Java code coverage report

We have integrated Jacoco to generate code coverage report for FE tests (IMPALA-3572), e.g. one can manually run a FE test and get the reports by
{code:java}
(pushd fe && mvn test -Dtest=PlannerTest -DcodeCoverage){code}
The html reports are generated in ${IMPALA_FE_TEST_COVERAGE_DIR}.

To get the FE code coverage report for e2e and custom-cluster tests, we can start the impala cluster with a java agent provided by Jacoco, e.g.
{code:java}
jvm_args="-javaagent:/home/quanlong/.m2/repository/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar=destfile=/home/quanlong/workspace/Impala/logs/fe_tests/coverage/jacoco.exec,jmx=true"{code}
The Jacoco agent doesn't dump the exec data when Impala process is killed (probably due to JVM not exit gracefully). We need to use jconsole to trigger the dump operation (via JMX beans). Then generate the report base on the exec data.

We need to make this automatic, especially for custom-cluster tests that will restart the cluster at the begining.

[https://www.jacoco.org/jacoco/trunk/doc/agent.html]
[https://www.jacoco.org/jacoco/trunk/doc/api/org/jacoco/agent/rt/IAgent.html]
[https://www.jacoco.org/jacoco/trunk/doc/cli.html]

h4. C++ code coverage report

buildall.sh has an option, -codecoverage, to build with gcov. We can get the coverage data for C++ codes when the process exit. Then use "bin/coverage_helper.sh -report" to generate the html reports.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org