-
Notifications
You must be signed in to change notification settings - Fork 52
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
Changes from all commits
57817f6
52817f7
809cd9a
5fee7da
f639628
ca28da0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request | ||
--- | ||
name: Dependabot auto-merge | ||
on: pull_request | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
dependabot-automerge: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Run full tests | ||
on: | ||
schedule: | ||
- cron: '0 1 * * 6' | ||
workflow_dispatch: | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
set -x | ||
git fetch | ||
if gh pr checkout full-tests | ||
then | ||
gh pr close --comment 'Recreating' | ||
git checkout master | ||
git branch -D full-tests | ||
git push origin :full-tests | ||
git reset --hard master | ||
fi | ||
git checkout -b full-tests | ||
# GitHub apparently does not let you create a PR with no commits: | ||
git commit --allow-empty --message 'Phony commit' | ||
jglick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
git push origin full-tests | ||
# Not using --draft to ensure notifications are sent: | ||
gh pr create --head --title 'Testing master (do not merge)' --body 'Close this PR if it passes; otherwise please fix failures.' --reviewer jenkinsci/bom-developers --label full-test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested in #2052. |
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,17 +4,17 @@ if (BRANCH_NAME == 'master' && currentBuild.buildCauses*._class == ['jenkins.bra | |||||
error 'No longer running builds on response to master branch pushes. If you wish to cut a release, use “Re-run checks” from this failing check in https://github.com/jenkinsci/bom/commits/master' | ||||||
} | ||||||
|
||||||
def mavenEnv(Map params = [:], Closure body) { | ||||||
def mavenEnv(boolean nodePool, int jdk, Closure body) { | ||||||
def attempt = 0 | ||||||
def attempts = 3 | ||||||
retry(count: attempts, conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()]) { | ||||||
echo 'Attempt ' + ++attempt + ' of ' + attempts | ||||||
// no Dockerized tests; https://github.com/jenkins-infra/documentation/blob/master/ci.adoc#container-agents | ||||||
node('maven-bom') { | ||||||
node(nodePool ? 'maven-bom': "maven-$jdk") { | ||||||
timeout(120) { | ||||||
infra.withArtifactCachingProxy { | ||||||
withEnv([ | ||||||
"JAVA_HOME=/opt/jdk-$params.jdk", | ||||||
"JAVA_HOME=/opt/jdk-$jdk", | ||||||
"MAVEN_ARGS=${env.MAVEN_ARGS != null ? MAVEN_ARGS : ''} -B -ntp -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo" | ||||||
]) { | ||||||
body() | ||||||
|
@@ -41,10 +41,9 @@ def parsePlugins(plugins) { | |||||
|
||||||
def pluginsByRepository | ||||||
def lines | ||||||
def fullTest = env.CHANGE_ID && pullRequest.labels.contains('full-test') | ||||||
|
||||||
stage('prep') { | ||||||
mavenEnv(jdk: 11) { | ||||||
mavenEnv(false, 11) { | ||||||
checkout scm | ||||||
withEnv(['SAMPLE_PLUGIN_OPTS=-Dset.changelist']) { | ||||||
withCredentials([ | ||||||
|
@@ -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 -> | ||||||
|
@@ -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] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. equivalently,
Suggested change
|
||||||
lines.each {line -> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(true, 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() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,4 @@ actions: | |
spec: | ||
labels: | ||
- dependencies | ||
- full-test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are updating PCT, presumably we want to run it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on #2036, #2038, #2039.