Skip to content

Commit

Permalink
Ignore the test
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Sep 20, 2021
1 parent 3122d43 commit c836091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/test/java/hudson/model/JobTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import hudson.EnvVars;
import hudson.Platform;
import org.hamcrest.CoreMatchers;
import org.junit.Ignore;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.mockito.ArgumentMatchers;
Expand Down Expand Up @@ -39,6 +40,7 @@ public void testSetDisplayNameZeroLength() throws Exception {

@Issue("JENKINS-14807")
@Test
@Ignore("Test doesn't work with static state, needs rethinking / removing")
public void use_agent_platform_path_separator_when_contribute_path() throws Throwable {
// mock environment to simulate EnvVars of agent node with different platform than master
Platform agentPlatform = Platform.current() == Platform.UNIX ? Platform.WINDOWS : Platform.UNIX;
Expand All @@ -50,7 +52,6 @@ public void use_agent_platform_path_separator_when_contribute_path() throws Thro
// environments are prepared after mock the Platform.current() method
emptyEnv = new EnvVars();
agentEnv = new EnvVars(EnvVars.masterEnvVars);
}
Job<?, ?> job = Mockito.mock(FreeStyleProject.class);
Mockito.when(job.getEnvironment(ArgumentMatchers.any(Node.class), ArgumentMatchers.any(TaskListener.class))).thenCallRealMethod();
Mockito.when(job.getCharacteristicEnvVars()).thenReturn(emptyEnv);
Expand All @@ -73,5 +74,6 @@ public void use_agent_platform_path_separator_when_contribute_path() throws Thro
assertThat("The contributed PATH was not joined using the path separator defined in agent node", //
env.get("PATH"), //
CoreMatchers.containsString(path + (agentPlatform == Platform.WINDOWS ? ';' : ':')));
}
}
}

0 comments on commit c836091

Please sign in to comment.