[feature](fe) Add coverage tool for FE UT (#26203)
This commit is contained in:
@ -877,7 +877,7 @@ under the License.
|
||||
<reuseForks>false</reuseForks>
|
||||
<useFile>false</useFile>
|
||||
<argLine>
|
||||
-Xmx512m -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
|
||||
-Xmx512m -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar @{argLine}
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
27
fe/pom.xml
27
fe/pom.xml
@ -111,6 +111,19 @@ under the License.
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${jacoco.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
@ -178,6 +191,19 @@ under the License.
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.9.1.2184</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${jacoco.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
@ -323,6 +349,7 @@ under the License.
|
||||
<!-- arrow flight sql -->
|
||||
<arrow.vector.classifier>shade-format-flatbuffers</arrow.vector.classifier>
|
||||
<flatbuffers.version>1.12.0</flatbuffers.version>
|
||||
<jacoco.version>0.8.10</jacoco.version>
|
||||
</properties>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
||||
@ -120,7 +120,7 @@ under the License.
|
||||
<!-->not reuse forked jvm, so that each unit test will run in separate jvm. to avoid singleton confict<-->
|
||||
<reuseForks>false</reuseForks>
|
||||
<argLine>
|
||||
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
|
||||
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar @{argLine}
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
26
run-fe-ut.sh
26
run-fe-ut.sh
@ -107,18 +107,22 @@ if [[ -z "${FE_UT_PARALLEL}" ]]; then
|
||||
fi
|
||||
echo "Unit test parallel is: ${FE_UT_PARALLEL}"
|
||||
|
||||
if [[ "${COVERAGE}" -eq 1 ]]; then
|
||||
echo "Run coverage statistic"
|
||||
ant cover-test
|
||||
else
|
||||
if [[ "${RUN}" -eq 1 ]]; then
|
||||
echo "Run the specified class: $1"
|
||||
# eg:
|
||||
# sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest
|
||||
# sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest#testCreateDbAndTable+test2
|
||||
"${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -D test="$1"
|
||||
if [[ "${RUN}" -eq 1 ]]; then
|
||||
echo "Run the specified class: $1"
|
||||
# eg:
|
||||
# sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest
|
||||
# sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest#testCreateDbAndTable+test2
|
||||
|
||||
if [[ "${COVERAGE}" -eq 1 ]]; then
|
||||
"${MVN_CMD}" test jacoco:report -DfailIfNoTests=false -Dtest="$1"
|
||||
else
|
||||
"${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest="$1"
|
||||
fi
|
||||
else
|
||||
echo "Run Frontend UT"
|
||||
if [[ "${COVERAGE}" -eq 1 ]]; then
|
||||
"${MVN_CMD}" test jacoco:report -DfailIfNoTests=false
|
||||
else
|
||||
echo "Run Frontend UT"
|
||||
"${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user