-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test regressions after JTH bump #9762
Conversation
@@ -104,7 +104,7 @@ public void run(JenkinsRule r) throws Throwable { | |||
p.setAssignedNode(agent); | |||
FreeStyleBuild b = r.buildAndAssertSuccess(p); | |||
if (webSocket) { | |||
assertThat(agent.toComputer().getSystemProperties().get("java.class.path"), is(new File(r.jenkins.root, "agent.jar").getAbsolutePath())); | |||
assertThat(agent.toComputer().getSystemProperties().get("java.class.path").toString(), endsWith("agent.jar")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Test | ||
public void runWithCurrentAgentJar() throws Throwable { | ||
runWithRemoting(null, null, false); | ||
} | ||
|
||
private void runWithRemoting(String expectedRemotingVersion, String remotingResourcePath, boolean requestingJarFromAgent) throws Throwable { | ||
if (expectedRemotingVersion != null) { | ||
FileUtils.copyURLToFile(Security3430Test.class.getResource(remotingResourcePath), new File(jj.getHome(), "agent.jar")); | ||
// TODO brittle; rather call InboundAgentRule.start(AgentArguments, Options) with a known agentJar | ||
FileUtils.copyURLToFile(Security3430Test.class.getResource(remotingResourcePath), new File(System.getProperty("java.io.tmpdir"), "agent.jar")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced in 5d26b53. jenkinsci/jenkins-test-harness#838 picks a different location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jenkinsci/jenkins-test-harness#843 fixes location reuse that likely caused the failure being @Ignore
d here.
@@ -126,7 +129,7 @@ private static void _run(JenkinsRule j, String agentName, String expectedRemotin | |||
if (requestingJarFromAgent) { | |||
assertThat(logRecords, hasItem(logMessageContainsString("Allowing URL: file:/"))); | |||
} else { | |||
assertThat(logRecords, is(empty())); | |||
assertThat(logRecords.stream().map(LogRecord::getMessage).toList(), is(empty())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous failure message was unhelpful (LogRecord
does not override toString
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Supersedes #9759. Downstream of jenkinsci/jenkins-test-harness#842.