mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-26 19:15:09 +00:00
Reduce Windows test time in CI (#27204)
This commit is contained in:
1 parent
1bfa99d948
commit
c858773e22
5 files changed
+23
No files matched your search
@@ -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<FreeStyleBuild> 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);
|
||||
|
||||
@@ -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<FreeStyleBuild> f = p.scheduleBuild2(30);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user