File tree Expand file tree Collapse file tree 6 files changed +23
-7
lines changed
csanchez/jenkins/plugins/kubernetes/pipeline
resources/org/csanchez/jenkins/plugins/kubernetes/pipeline Expand file tree Collapse file tree 6 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 4949 <no-test-jar >false</no-test-jar >
5050 <useBeta >true</useBeta >
5151 <gitHubRepo >jenkinsci/${project.artifactId}-plugin</gitHubRepo >
52+ <jenkins-test-harness .version>1922.v91779ee45b_5e</jenkins-test-harness .version>
5253 </properties >
5354
5455 <dependencies >
Original file line number Diff line number Diff line change 22
33import static org .csanchez .jenkins .plugins .kubernetes .KubernetesTestUtil .assumeKubernetes ;
44
5+ import org .apache .commons .lang .StringUtils ;
56import org .csanchez .jenkins .plugins .kubernetes .KubernetesTestUtil ;
67import org .csanchez .jenkins .plugins .kubernetes .pipeline .steps .CreateWorkflowJobThenScheduleRun ;
78import org .csanchez .jenkins .plugins .kubernetes .pipeline .steps .RunId ;
@@ -18,7 +19,21 @@ public abstract class AbstractKubernetesPipelineRJRTest {
1819 public TestName name = new TestName ();
1920
2021 @ Rule
21- public RealJenkinsRule rjr = new RealJenkinsRule ();
22+ public RealJenkinsRule rjr ;
23+ {
24+ rjr = new RealJenkinsRule ();
25+ String connectorHost = System .getProperty ("connectorHost" );
26+ if (StringUtils .isNotBlank (connectorHost )) {
27+ System .err .println ("Listening on host address: " + connectorHost );
28+ rjr .withHttpListenAddress (connectorHost );
29+ }
30+ String port = System .getProperty ("port" );
31+ if (StringUtils .isNotBlank (port )) {
32+ System .err .println ("Overriding port using system property: " + port );
33+ rjr = rjr .withPort (Integer .parseInt (port ));
34+ }
35+ }
36+
2237
2338 protected RunId runId ;
2439
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ public KubernetesPipelineRJRTest() throws UnknownHostException {
1212 }
1313
1414 @ Test
15- @ Ignore // Need RealJenkinsRule to accept a custom port
1615 public void basicPipeline () throws Throwable {
1716 rjr .runRemotely (new AssertBuildStatusSuccess (runId ));
1817 }
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ public KubernetesPipelineWebsocketRJRTest() throws UnknownHostException {
2222 super (new SetupCloud (true ));
2323 }
2424 @ Test
25- @ Ignore // Need RealJenkinsRule to accept a custom port
2625 public void basicPipeline () throws Throwable {
2726 rjr .runRemotely (new AssertBuildStatusSuccess (runId ));
2827 }
Original file line number Diff line number Diff line change 3434
3535import javax .servlet .ServletContext ;
3636
37+ import org .apache .commons .lang3 .StringUtils ;
3738import org .eclipse .jetty .http .HttpCompliance ;
3839import org .eclipse .jetty .http .UriCompliance ;
3940import org .eclipse .jetty .server .HttpConfiguration ;
@@ -95,9 +96,10 @@ public Thread newThread(Runnable r) {
9596 System .err .println ("Listening on host address: " + HOST );
9697 connector .setHost (HOST );
9798
98- if (System .getProperty ("port" )!=null ) {
99- LOGGER .info ("Overriding port using system property: " + System .getProperty ("port" ));
100- connector .setPort (Integer .parseInt (System .getProperty ("port" )));
99+ String customPort = System .getProperty ("port" );
100+ if (StringUtils .isNotBlank (customPort )) {
101+ LOGGER .info ("Overriding port using system property: " + customPort );
102+ connector .setPort (Integer .parseInt (customPort ));
101103 } else {
102104 if (port != null ) {
103105 connector .setPort (port );
Original file line number Diff line number Diff line change 1- podTemplate {
1+ podTemplate( yaml : ' ' ) {
22 node(POD_LABEL ) {
33 sh ' true'
44 }
You can’t perform that action at this time.
0 commit comments