Skip to content

Commit 53e0fd4

Browse files
authored
fix: Exception while configuring coverage publisher [JENKINS-76010] (#938)
* fix: Exception while configuring coverage publisher [JENKINS-76010] * fix CI * increase timeout
1 parent 9e7bf70 commit 53e0fd4

File tree

11 files changed

+1960
-49
lines changed

11 files changed

+1960
-49
lines changed

Jenkinsfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ buildPlugin(
77
configurations: [
88
[ platform: "linux", jdk: "21" ],
99
[ platform: "windows", jdk: "17" ]
10-
]
10+
],
11+
timeout: 120
1112
)

pipeline-maven-ui-tests/pom.xml

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ The MIT License
4+
~
5+
~ Copyright (c) 2016, CloudBees, Inc.
6+
~
7+
~ Permission is hereby granted, free of charge, to any person obtaining a copy
8+
~ of this software and associated documentation files (the "Software"), to deal
9+
~ in the Software without restriction, including without limitation the rights
10+
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
~ copies of the Software, and to permit persons to whom the Software is
12+
~ furnished to do so, subject to the following conditions:
13+
~
14+
~ The above copyright notice and this permission notice shall be included in
15+
~ all copies or substantial portions of the Software.
16+
~
17+
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
~ THE SOFTWARE.
24+
-->
25+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26+
<modelVersion>4.0.0</modelVersion>
27+
28+
<parent>
29+
<groupId>org.jenkins-ci.plugins</groupId>
30+
<artifactId>pipeline-maven-parent</artifactId>
31+
<version>${changelist}</version>
32+
</parent>
33+
34+
<artifactId>pipeline-maven-ui-tests</artifactId>
35+
<version>UNVERSIONED</version>
36+
<name>UI Tests of Pipeline Maven Integration Plugin</name>
37+
38+
<properties>
39+
<argLine>-Djava.awt.headless=true -Xmx1024m -Djenkins.test.timeout=1000 --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED</argLine>
40+
<browser>firefox-container</browser>
41+
</properties>
42+
43+
<dependencyManagement>
44+
<dependencies>
45+
<dependency>
46+
<groupId>com.fasterxml.jackson</groupId>
47+
<artifactId>jackson-bom</artifactId>
48+
<version>${jackson.version}</version>
49+
<type>pom</type>
50+
<scope>import</scope>
51+
</dependency>
52+
<dependency>
53+
<!-- ClassNotFoundException if omitted -->
54+
<groupId>io.netty</groupId>
55+
<artifactId>netty-bom</artifactId>
56+
<version>${netty.version}</version>
57+
<type>pom</type>
58+
<scope>import</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>com.google.errorprone</groupId>
62+
<artifactId>error_prone_annotations</artifactId>
63+
<version>${error-prone.version}</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.apache.maven</groupId>
67+
<artifactId>maven-artifact</artifactId>
68+
<version>3.9.6</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.javassist</groupId>
72+
<artifactId>javassist</artifactId>
73+
<version>${javassist.version}</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.jenkins-ci.main</groupId>
77+
<artifactId>jenkins-core</artifactId>
78+
<version>${jenkins.version}</version>
79+
</dependency>
80+
</dependencies>
81+
</dependencyManagement>
82+
83+
<dependencies>
84+
<dependency>
85+
<groupId>org.jenkins-ci</groupId>
86+
<artifactId>acceptance-test-harness</artifactId>
87+
<version>${jenkins-acceptance-test-harness.version}</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>com.fasterxml.jackson.core</groupId>
91+
<artifactId>jackson-databind</artifactId>
92+
<scope>test</scope>
93+
</dependency>
94+
<dependency>
95+
<groupId>net.javacrumbs.json-unit</groupId>
96+
<artifactId>json-unit-assertj</artifactId>
97+
<version>${json-unit-assertj.version}</version>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>net.javacrumbs.json-unit</groupId>
102+
<artifactId>json-unit-json-path</artifactId>
103+
<version>${json-unit-assertj.version}</version>
104+
<scope>test</scope>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.apache.httpcomponents</groupId>
108+
<artifactId>httpclient</artifactId>
109+
<version>${httpclient.version}</version>
110+
<scope>test</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.junit.vintage</groupId>
114+
<artifactId>junit-vintage-engine</artifactId>
115+
<version>${junit.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
</dependencies>
119+
120+
<build>
121+
<plugins>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-javadoc-plugin</artifactId>
125+
<configuration>
126+
<skip>true</skip>
127+
</configuration>
128+
</plugin>
129+
<plugin>
130+
<groupId>org.apache.maven.plugins</groupId>
131+
<artifactId>maven-resources-plugin</artifactId>
132+
<executions>
133+
<execution>
134+
<id>copy-resources</id>
135+
<goals>
136+
<goal>copy-resources</goal>
137+
</goals>
138+
<phase>process-resources</phase>
139+
<configuration>
140+
<outputDirectory>../pipeline-maven/target/test-classes/test-dependencies</outputDirectory>
141+
<resources>
142+
<resource>
143+
<directory>../pipeline-maven/target/</directory>
144+
<includes>
145+
<include>pipeline-maven.hpi</include>
146+
</includes>
147+
<filtering>false</filtering>
148+
</resource>
149+
</resources>
150+
</configuration>
151+
</execution>
152+
</executions>
153+
</plugin>
154+
<plugin>
155+
<artifactId>maven-surefire-plugin</artifactId>
156+
<configuration>
157+
<reuseForks>false</reuseForks>
158+
<trimStackTrace>false</trimStackTrace>
159+
<!-- SUREFIRE-1798 -->
160+
<environmentVariables>
161+
<PLUGINS_DIR>../pipeline-maven/target/test-classes/test-dependencies</PLUGINS_DIR>
162+
<JENKINS_VERSION>${jenkins.version}</JENKINS_VERSION>
163+
<BROWSER>${browser}</BROWSER>
164+
<SKIP_UPDATES>true</SKIP_UPDATES>
165+
</environmentVariables>
166+
<rerunFailingTestsCount>1</rerunFailingTestsCount>
167+
</configuration>
168+
</plugin>
169+
<plugin>
170+
<groupId>org.jenkins-ci.tools</groupId>
171+
<artifactId>maven-hpi-plugin</artifactId>
172+
</plugin>
173+
</plugins>
174+
</build>
175+
176+
<profiles>
177+
<profile>
178+
<id>no-ui-tests-on-windows</id>
179+
<activation>
180+
<os>
181+
<family>windows</family>
182+
</os>
183+
</activation>
184+
<properties>
185+
<maven.test.skip>true</maven.test.skip>
186+
</properties>
187+
</profile>
188+
</profiles>
189+
190+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.jenkinsci.plugins.maven;
2+
3+
import org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider;
4+
import org.jenkinsci.test.acceptance.plugins.config_file_provider.ProvidedFile;
5+
import org.jenkinsci.test.acceptance.po.CodeMirror;
6+
import org.jenkinsci.test.acceptance.po.Describable;
7+
8+
@Describable("Global Maven settings.xml")
9+
public class GlobalMavenSettingsConfig extends ProvidedFile {
10+
11+
public GlobalMavenSettingsConfig(ConfigFileProvider context, String id) {
12+
super(context, id);
13+
}
14+
15+
@Override
16+
public void content(String mvnSettings) {
17+
new CodeMirror(this, "/config/content").set(mvnSettings);
18+
}
19+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.jenkinsci.plugins.maven;
2+
3+
import org.apache.commons.lang3.StringUtils;
4+
import org.jenkinsci.test.acceptance.po.Jenkins;
5+
import org.jenkinsci.test.acceptance.po.PageObject;
6+
import org.jenkinsci.test.acceptance.po.WorkflowJob;
7+
import org.openqa.selenium.By;
8+
import org.openqa.selenium.WebElement;
9+
10+
public class SnippetGenerator extends PageObject {
11+
12+
private static final String URI = "pipeline-syntax/";
13+
14+
public SnippetGenerator(Jenkins jenkins) {
15+
super(jenkins.injector, jenkins.url(URI));
16+
}
17+
18+
public SnippetGenerator(final WorkflowJob context) {
19+
super(context, context.url(URI));
20+
}
21+
22+
public String generateScript() {
23+
WebElement generateButton = find(By.id("generatePipelineScript"));
24+
generateButton.click();
25+
26+
WebElement snippet = find(By.id("prototypeText"));
27+
waitFor().until(() -> StringUtils.isNotBlank(snippet.getAttribute("value")));
28+
29+
return StringUtils.defaultString(snippet.getAttribute("value"));
30+
}
31+
}

0 commit comments

Comments
 (0)