Skip to content
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

Skip PCT by default on PRs #2034

Merged
merged 6 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 27 additions & 30 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def parsePlugins(plugins) {

def pluginsByRepository
def lines
def fullTest = env.CHANGE_ID && pullRequest.labels.contains('full-test')

stage('prep') {
mavenEnv(jdk: 11) {
Expand All @@ -61,10 +60,6 @@ stage('prep') {
pluginsByRepository = parsePlugins(plugins)

lines = readFile('lines.txt').split('\n')
if (env.CHANGE_ID && !fullTest) {
// run PCT only on newest and oldest lines, to save resources (but check all lines on deliberate master builds)
lines = [lines[0], lines[-1]]
}
launchable.install()
withCredentials([string(credentialsId: 'launchable-jenkins-bom', variable: 'LAUNCHABLE_TOKEN')]) {
lines.each { line ->
Expand All @@ -85,35 +80,37 @@ stage('prep') {
}
}

branches = [failFast: !fullTest]
lines.each {line ->
pluginsByRepository.each { repository, plugins ->
branches["pct-$repository-$line"] = {
def jdk = line == 'weekly' ? 17 : 11
mavenEnv(jdk: jdk) {
unstash line
withEnv([
"PLUGINS=${plugins.join(',')}",
"LINE=$line",
'EXTRA_MAVEN_PROPERTIES=maven.test.failure.ignore=true:surefire.rerunFailingTestsCount=1'
]) {
sh '''
mvn -v
bash pct.sh
'''
}
launchable.install()
withCredentials([string(credentialsId: 'launchable-jenkins-bom', variable: 'LAUNCHABLE_TOKEN')]) {
launchable('verify')
def sessionFile = "launchable-session-${line}.txt"
unstash sessionFile
def session = readFile(sessionFile).trim()
launchable("record tests --session ${session} --group ${repository} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
if (BRANCH_NAME == 'master' || env.CHANGE_ID && pullRequest.labels.contains('full-test')) {
branches = [failFast: false]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equivalently,

Suggested change
branches = [failFast: false]
branches = [:]

lines.each {line ->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide whitespace to see real change

pluginsByRepository.each { repository, plugins ->
branches["pct-$repository-$line"] = {
def jdk = line == 'weekly' ? 17 : 11
mavenEnv(jdk: jdk) {
unstash line
withEnv([
"PLUGINS=${plugins.join(',')}",
"LINE=$line",
'EXTRA_MAVEN_PROPERTIES=maven.test.failure.ignore=true:surefire.rerunFailingTestsCount=1'
]) {
sh '''
mvn -v
bash pct.sh
'''
}
launchable.install()
withCredentials([string(credentialsId: 'launchable-jenkins-bom', variable: 'LAUNCHABLE_TOKEN')]) {
launchable('verify')
def sessionFile = "launchable-session-${line}.txt"
unstash sessionFile
def session = readFile(sessionFile).trim()
launchable("record tests --session ${session} --group ${repository} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
}
}
}
}
}
parallel branches
}
parallel branches

infra.maybePublishIncrementals()
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ If the build fails due to an unmanaged transitive plugin dependency, add it to

## PCT

The CI build tries running the [Plugin Compatibility Tester (PCT)](https://github.com/jenkinsci/plugin-compat-tester/)
The CI build can run the [Plugin Compatibility Tester (PCT)](https://github.com/jenkinsci/plugin-compat-tester/)
on the particular combination of plugins being managed by the BOM.
This catches mutual incompatibilities between plugins
(as revealed by their `JenkinsRule` tests)
Expand All @@ -168,7 +168,10 @@ DOCKERIZED=true

to reproduce image-specific failures.

Note that to minimize build time, tests are run only on Linux, against JDK 8, and without Docker support.
To minimize cloud resources, PCT is not run at all by default on pull requests, only some basic sanity checks.
Add the label `full-test` to run PCT in a PR.

To further minimize build time, tests are run only on Linux, against Java 11, and without Docker support.
It is unusual but possible for cross-component incompatibilities to only be visible in more specialized environments (such as Windows).

## LTS lines
Expand All @@ -187,10 +190,6 @@ The UC currently maintains releases for the [past 400 days](https://groups.googl
so it is reasonable to retire BOMs for lines older than that,
or otherwise when the number of accumulated version overrides becomes large.

Add the label `full-test` in dangerous-looking PRs to make sure you are running tests in all LTS lines;
by default tests are only run in the oldest line and weeklies.
This flag also allows all tests to be run even after some failures are recorded.

## Releasing

You can cut a release using [JEP-229](https://jenkins.io/jep/229).
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/plugin-compat-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ actions:
spec:
labels:
- dependencies
- full-test
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are updating PCT, presumably we want to run it!