Skip to content

Commit

Permalink
Fetch all branches during CI.
Browse files Browse the repository at this point in the history
We recently altered the Jenkins config so that it only tests PRs
as they are, rather than testing them merged with their destination
branch. This apparently caused the git checkout not to have the
reference for the destination branch, which is needed for
diff-cover to work.

Signed-off-by: Randy Barlow <[email protected]>
(cherry picked from commit 0d8c491)
  • Loading branch information
bowlofeggs committed Feb 7, 2019
1 parent e0ca5bc commit 31a3725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion devel/ci/bodhi-ci
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class DiffCoverJob(Job):
self.archive_path = archive_path

self._command = ['/usr/bin/diff-cover', '/results/coverage.xml',
'--compare-branch=3.13', '--fail-under=100']
'--compare-branch=origin/3.13', '--fail-under=100']
self._label = '{}-py{}'.format(self._label, pyver)
self._convert_command_for_container(archive=archive, archive_path=archive_path)

Expand Down
9 changes: 3 additions & 6 deletions devel/ci/cico.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ def test_release = { String release ->

node('bodhi') {
checkout scm
// diff-cover sometimes fails to identify origin/3.13, so let's check out the 3.13 branch
// and then switch back to the commit we are testing so there is a 3.13 branch available
// for diff-cover to use later. See https://github.com/Bachmann1234/diff-cover/issues/55
sh 'git branch -f the_commit_we_are_testing HEAD'
sh 'git checkout 3.13'
sh 'git checkout the_commit_we_are_testing'
// diff-cover needs to be able to reference origin/3.13, so let's just fetch all branches.
sh 'git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*'
sh 'git fetch -p --no-tags origin'

stage('Allocate Duffy node') {
env.CICO_API_KEY = readFile("${env.HOME}/duffy.key").trim()
Expand Down

0 comments on commit 31a3725

Please sign in to comment.