Skip to content

Commit

Permalink
Maven plugins and dependencies update (#1906)
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Felcman <[email protected]>
  • Loading branch information
rfelcman committed Jul 18, 2023
1 parent 6d59a82 commit 33b5106
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 96 deletions.
93 changes: 74 additions & 19 deletions bundles/nightly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
Expand Down Expand Up @@ -113,7 +113,7 @@
<executions>
<execution>
<id>generate-test-summary-html-report</id>
<phase>package</phase>
<phase>generate-resources</phase>
<goals>
<goal>failsafe-report-only</goal>
</goals>
Expand All @@ -123,7 +123,30 @@
</reportsDirectories>
<outputDirectory>${project.build.directory}/jpa-test-reports/${project.build.testReports.subdirectory}</outputDirectory>
<outputName>${project.build.testReports.summaryFile}</outputName>
<title>EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )</title>
<customBundle>${project.basedir}/src/site/custom/surefire-report.properties</customBundle>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>prepare-nightly-build-dir-test-reports-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy todir="${project.build.directory}${nightlyDir}/Eclipse/css/">
<fileset dir="../../foundation/eclipselink.core.test/target/${project.build.testReports.subdirectory}/css/"/>
</copy>
<copy todir="${project.build.directory}${nightlyDir}/Eclipse/images/">
<fileset dir="../../foundation/eclipselink.core.test/target/${project.build.testReports.subdirectory}/images/"/>
</copy>
</target>
</configuration>
</execution>
</executions>
Expand All @@ -134,7 +157,7 @@
<executions>
<execution>
<id>prepare-nightly-build-dir-test-reports</id>
<phase>package</phase>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
Expand Down Expand Up @@ -217,7 +240,7 @@
</execution>
<execution>
<id>prepare-nightly-build-dir-binaries</id>
<phase>package</phase>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
Expand Down Expand Up @@ -273,6 +296,34 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>fix-test-reports</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Fix some non-XML valid sequence in test reports -->
<replace dir="${project.build.directory}${nightlyDir}/Eclipse/">
<include name="**/*.html"/>
<replacefilter>
<replacetoken><![CDATA[&&]]></replacetoken>
<replacevalue><![CDATA[&amp;&amp;]]></replacevalue>
</replacefilter>
</replace>
<chmod dir="${project.build.directory}${nightlyDir}/Eclipse/" perm="644">
<include name="**/*.html"/>
</chmod>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
Expand All @@ -289,9 +340,10 @@
import javax.xml.xpath.XPathFactory
import javax.xml.parsers.DocumentBuilderFactory
final NO_OF_TESTS_XPATH = "/html/body/div[@id='bodyColumn']/div/section[2]/table/tr[2]/td[1]/text()"
final NO_OF_ERRORS_XPATH = "/html/body/div[@id='bodyColumn']/div/section[2]/table/tr[2]/td[2]/text()"
final NO_OF_FAILURES_XPATH = "/html/body/div[@id='bodyColumn']/div/section[2]/table/tr[2]/td[3]/text()"
final NO_OF_TESTS_XPATH = "/html/body/div[@id='bodyColumn']/div[@id='contentBox']/section[2]/table/tr[2]/td[1]/text()"
final NO_OF_ERRORS_XPATH = "/html/body/div[@id='bodyColumn']/div[@id='contentBox']/section[2]/table/tr[2]/td[2]/text()"
final NO_OF_FAILURES_XPATH = "/html/body/div[@id='bodyColumn']/div[@id='contentBox']/section[2]/table/tr[2]/td[3]/text()"
final OUTPUT_FILE = "ResultSummary.dat"
def resultSummaryFile = new File(properties["nightlyTestReportsDir"] + "/" + OUTPUT_FILE)
Expand All @@ -318,18 +370,21 @@
}
File[] files = reportDir.listFiles()
for (File file : files) {
try {
noOfTests = processXml(file.text, NO_OF_TESTS_XPATH)
noOfNewTests = noOfTests
noOfErrors = processXml(file.text, NO_OF_ERRORS_XPATH) +
processXml(file.text, NO_OF_FAILURES_XPATH)
} catch (Exception e) {
log.warn "File: " + file.getName() + " can't be parsed. Result will be marked as a failed test!"
noOfTests = 1
noOfNewTests = 1
noOfErrors = 1
if (file.isFile()) {
try {
noOfTests = processXml(file.text, NO_OF_TESTS_XPATH)
noOfNewTests = noOfTests
noOfErrors = processXml(file.text, NO_OF_ERRORS_XPATH) + processXml(file.text, NO_OF_FAILURES_XPATH)
} catch (Exception e) {
log.warn "Error cause: ${e}"
log.warn "File: " + file.getName() + " can't be parsed. Result will be marked as a failed test!"
noOfTests = 1
noOfNewTests = 1
noOfErrors = 1
}
resultSummaryFile.append file.
getName() + ":" + noOfTests + ":" + noOfNewTests + ":" + noOfErrors + "\n"
}
resultSummaryFile.append file.getName() + ":" + noOfTests + ":" + noOfNewTests + ":" + noOfErrors + "\n"
}
println resultSummaryFile.text
]]>
Expand Down
18 changes: 18 additions & 0 deletions bundles/nightly/src/site/custom/surefire-report.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0,
# or the Eclipse Distribution License v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

report.failsafe.description=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
report.failsafe.name=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
report.failsafe.title=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
report.surefire.description=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
report.surefire.name=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
report.surefire.title=EclipseLink JPA Test - Test Summary (more details on ${env.BUILD_URL} )
13 changes: 0 additions & 13 deletions foundation/org.eclipse.persistence.oracle.nosql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>jar-test-sources</id>
<phase>package</phase>
<goals>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
13 changes: 0 additions & 13 deletions foundation/org.eclipse.persistence.oracle.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>jar-test-sources</id>
<phase>package</phase>
<goals>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
Loading

0 comments on commit 33b5106

Please sign in to comment.