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

Use the same branch name for ITs on Jenkins #1263

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,21 @@ for (String os in runITsOses) {
// will not trample each other plus workaround for JENKINS-52657
dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
def WORK_DIR=pwd()
checkout([$class: 'GitSCM',
branches: [[name: "*/master"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME;
try {
echo "Checkout ITs from branch: ${ITS_BRANCH}"
checkout([$class: 'GitSCM',
branches: [[name: ITS_BRANCH]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
Copy link
Contributor

Choose a reason for hiding this comment

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

We're still using the maven-integration-testing GitHub repo, but it needs to point to the same repository from the PR.

Copy link
Member

Choose a reason for hiding this comment

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

Didn't we say earlier to use only master for this build?
Or I'm lost?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, then, what's the point of this PR ? I'm lost too...

Copy link
Member Author

Choose a reason for hiding this comment

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

Jobs on jenkins are not executed for PR from forked repository.

The goal is minimize a failed build PR on jenkins, when we have change in Maven and connected in ITs.

Copy link
Member Author

Choose a reason for hiding this comment

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

We also have a https://github.com/apache/maven-integration-testing/tree/maven-3.8.x branch in ITs - so this branch should be used for testing maven-3.8.x and so on

Copy link
Member Author

Choose a reason for hiding this comment

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

@gnodet, @olamy I still think that change is good enough

build for #1273 pass on GH but fail on Jenkins

} catch (Throwable e) {
echo "Failure checkout ITs branch: ${ITS_BRANCH} - fallback master branch"
checkout([$class: 'GitSCM',
branches: [[name: "*/master"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
}

if (isUnix()) {
sh "rm -rvf $WORK_DIR/dists $WORK_DIR/it-local-repo"
} else {
Expand Down