diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index 176243a5e5..18dd704a15 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -34,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import hudson.EnvVars; import hudson.FilePath; @@ -274,6 +275,7 @@ public class ProjectTest { @Test void testGetScmCheckoutRetryCount() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject p = j.createFreeStyleProject("project"); assertEquals(j.jenkins.getScmCheckoutRetryCount(), p.getScmCheckoutRetryCount(), "Scm retry count should be default."); j.jenkins.setScmCheckoutRetryCount(6); @@ -392,6 +394,7 @@ public class ProjectTest { @Test void testGetCauseOfBlockage() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject p = j.createFreeStyleProject("project"); p.getBuildersList().add(Functions.isWindows() ? new BatchFile("ping -n 10 127.0.0.1 >nul") : new Shell("sleep 10")); QueueTaskFuture b1 = waitForStart(p); @@ -463,6 +466,7 @@ public class ProjectTest { @Test void testCheckout() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); SCM scm = new NullSCM(); FreeStyleProject p = j.createFreeStyleProject("project"); Slave slave = j.createOnlineSlave(); @@ -577,6 +581,7 @@ public class ProjectTest { @Test void testDoDoDelete() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject project = j.createFreeStyleProject("project"); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); j.jenkins.setAuthorizationStrategy(auth); @@ -607,6 +612,7 @@ public class ProjectTest { @Test void testDoDoWipeOutWorkspace() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject project = j.createFreeStyleProject("project"); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); j.jenkins.setAuthorizationStrategy(auth); @@ -639,6 +645,7 @@ public class ProjectTest { @Test void testDoDisable() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject project = j.createFreeStyleProject("project"); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); j.jenkins.setAuthorizationStrategy(auth); @@ -666,6 +673,7 @@ public class ProjectTest { @Test void testDoEnable() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject project = j.createFreeStyleProject("project"); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); j.jenkins.setAuthorizationStrategy(auth); diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 784df19833..89ef072447 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -45,6 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.NonNull; @@ -569,6 +570,7 @@ public class QueueTest { @Issue("JENKINS-28926") @Test void upstreamDownstreamCycle() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject trigger = r.createFreeStyleProject(); FreeStyleProject chain1 = r.createFreeStyleProject(); FreeStyleProject chain2a = r.createFreeStyleProject(); @@ -1063,6 +1065,7 @@ public class QueueTest { @Test void waitForStartAndCancelBeforeStart() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); FreeStyleProject p = r.createFreeStyleProject(); QueueTaskFuture f = p.scheduleBuild2(30); diff --git a/test/src/test/java/hudson/model/ViewTest.java b/test/src/test/java/hudson/model/ViewTest.java index 57bc636cc5..128c759401 100644 --- a/test/src/test/java/hudson/model/ViewTest.java +++ b/test/src/test/java/hudson/model/ViewTest.java @@ -40,11 +40,13 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import com.cloudbees.hudson.plugins.folder.Folder; import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.ExtensionList; +import hudson.Functions; import hudson.XmlFile; import hudson.diagnosis.OldDataMonitor; import hudson.matrix.AxisList; @@ -886,6 +888,7 @@ class ViewTest { @Test @Issue("SECURITY-2171") void newJob_xssPreventedInGetIconFilePathPattern() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); CustomizableTLID customizableTLID = j.jenkins.getExtensionList(TopLevelItemDescriptor.class).get(CustomizableTLID.class); customizableTLID.customId = "xss-ifpp"; customizableTLID.customIconClassName = null; diff --git a/test/src/test/java/jenkins/security/Security1809Test.java b/test/src/test/java/jenkins/security/Security1809Test.java index 766268ab8e..81830a999d 100644 --- a/test/src/test/java/jenkins/security/Security1809Test.java +++ b/test/src/test/java/jenkins/security/Security1809Test.java @@ -3,8 +3,10 @@ package jenkins.security; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import com.cloudbees.hudson.plugins.folder.Folder; +import hudson.Functions; import hudson.model.Action; import hudson.model.Computer; import hudson.model.FreeStyleBuild; @@ -40,6 +42,7 @@ class Security1809Test { @Test @Issue("SECURITY-1809") void passwordIsMaskedForView() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); final PasswordView view = new PasswordView("view1", secretPassword); j.jenkins.addView(view); @@ -144,6 +147,7 @@ class Security1809Test { @Test @Issue("SECURITY-1809") void permissionIsCorrectlyCheckedOnNestedObject() throws Exception { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); final Folder folder = j.jenkins.createProject(Folder.class, "folder1"); final FreeStyleProject job = folder.createProject(FreeStyleProject.class, "job1"); FreeStyleBuild build = j.buildAndAssertSuccess(job); diff --git a/test/src/test/java/jenkins/security/Security3430Test.java b/test/src/test/java/jenkins/security/Security3430Test.java index 363ad0476e..8b51b224e6 100644 --- a/test/src/test/java/jenkins/security/Security3430Test.java +++ b/test/src/test/java/jenkins/security/Security3430Test.java @@ -11,8 +11,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import hudson.ExtensionList; +import hudson.Functions; import hudson.model.Computer; import hudson.remoting.Channel; import hudson.remoting.Launcher; @@ -60,16 +62,19 @@ class Security3430Test { @Test void runWithOldestSupportedAgentJar() throws Throwable { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); runWithRemoting(RemotingVersionInfo.getMinimumSupportedVersion().toString(), "/old-remoting/remoting-minimum-supported.jar", true); } @Test void runWithPreviousAgentJar() throws Throwable { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); runWithRemoting("3256.v88a_f6e922152", "/old-remoting/remoting-before-SECURITY-3430-fix.jar", true); } @Test void runWithCurrentAgentJar() throws Throwable { + assumeFalse(Functions.isWindows() && System.getenv("CI") != null, "Low value, high cost on Windows"); runWithRemoting(Launcher.VERSION, null, false); }