Skip to content

Commit 93150f2

Browse files
mPokornyETMgithub-actions[bot]
authored andcommitted
feat: Add fast-tests profile and tag slow tests for improved CI performance
1 parent 4ff1d67 commit 93150f2

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

Jenkinsfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
See the documentation for more options:
33
https://github.com/jenkins-infra/pipeline-library/
44
*/
5+
6+
// Skip slow tests on PRs for faster feedback; run all tests on release
7+
def profile = env.CHANGE_ID ? '-Pfast-tests' : ''
8+
59
buildPlugin(
610
forkCount: '1C', // Run parallel tests on ci.jenkins.io for lower costs, faster feedback
711
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
812
configurations: [
9-
[platform: 'linux', jdk: 25],
10-
[platform: 'windows', jdk: 21],
13+
[platform: 'linux', jdk: 25, extraMavenArguments: profile],
14+
[platform: 'windows', jdk: 21, extraMavenArguments: profile],
1115
])

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@
178178
</pluginRepository>
179179
</pluginRepositories>
180180

181+
<profiles>
182+
<!-- Fast tests for PR checks: skip slow tests -->
183+
<profile>
184+
<id>fast-tests</id>
185+
<properties>
186+
<excludedGroups>slow</excludedGroups>
187+
</properties>
188+
</profile>
189+
</profiles>
190+
181191
<build>
182192
<plugins>
183193
<plugin>

src/test/java/org/jenkins/plugins/lockableresources/LockStepWithRestartTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
1212
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
1313
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
14+
import org.junit.jupiter.api.Tag;
1415
import org.junit.jupiter.api.Test;
1516
import org.junit.jupiter.api.extension.RegisterExtension;
1617
import org.jvnet.hudson.test.JenkinsRule;
1718
import org.jvnet.hudson.test.junit.jupiter.JenkinsSessionExtension;
1819

20+
@Tag("slow")
1921
class LockStepWithRestartTest extends LockStepTestBase {
2022

2123
private static final Logger LOGGER = Logger.getLogger(LockStepTestBase.class.getName());

src/test/java/org/jenkins/plugins/lockableresources/PressureTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
1010
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
1111
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
12+
import org.junit.jupiter.api.Tag;
1213
import org.junit.jupiter.api.Test;
1314
import org.junit.jupiter.api.Timeout;
1415
import org.jvnet.hudson.test.JenkinsRule;
1516
import org.jvnet.hudson.test.junit.jupiter.WithJenkins;
1617

1718
@WithJenkins
19+
@Tag("slow")
1820
class PressureTest extends LockStepTestBase {
1921

2022
private static final Logger LOGGER = Logger.getLogger(PressureTest.class.getName());

0 commit comments

Comments
 (0)