Skip to content

Commit

Permalink
Merge pull request #1418 from Vlatombe/2.414-test-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Aug 16, 2023
2 parents 227c16b + 3bae76c commit 0141a5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<connectorHost />
<jenkins.host.address />
<slaveAgentPort />
<!-- TODO fix KubernetesCloudTest todos once past 2.414 -->
<jenkins.version>2.387.3</jenkins.version>
<no-test-jar>false</no-test-jar>
<useBeta>true</useBeta>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import hudson.util.VersionNumber;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -15,6 +16,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import jenkins.model.Jenkins;
import org.htmlunit.ElementNotFoundException;
import org.htmlunit.html.DomElement;
import org.htmlunit.html.DomNodeList;
Expand Down Expand Up @@ -73,14 +75,13 @@ public void configRoundTrip() throws Exception {
assertEquals("PodTemplate{id='"+podTemplate.getId()+"', name='test-template', label='test'}", podTemplate.toString());
}

// TODO 2.414+ delete
private HtmlPage getCloudPage(JenkinsRule.WebClient wc) throws IOException, SAXException {
HtmlPage p = wc.goTo("configureClouds/");
List<HtmlForm> forms = p.getForms();
// config page was moved in 2.414
if (forms.stream().noneMatch(htmlForm -> htmlForm.getNameAttribute().equals("config"))) {
p = wc.goTo("cloud/kubernetes/configure");
if (Jenkins.getVersion().isNewerThanOrEqualTo(new VersionNumber("2.414"))) {
return wc.goTo("cloud/kubernetes/configure");
} else {
return wc.goTo("configureClouds/");
}
return p;
}

@Test
Expand Down

0 comments on commit 0141a5f

Please sign in to comment.