提交 d8353eed 编写于 作者: C Cleber Rosa

Travis-CI: check the HEAD of the branch only

For a long time we have resorted to a hack, let's call it "all commits
hack", to test all commits in a branch on Travis-CI.  While it clear
had a positive side, it also had its annoyances.

Now, more and more often, we're faced with the obligation of breaking
PRs in smaller pieces just because of the limitations that the free
tier of Travis-CI imposes (for instance max job time is 50 minutes).

For instance, as this is written, the status of the master branch
is broken, because of the max job time.  And there's no way to
waive it or tweak it.

Also, the hack caused some really interesting problems, and caused
a lot of time wasted, for instance, because it masks the merge commit
that Travis-CI creates, and consequently, makes the signedoff-check.sh
fail on the real HEAD of the merged branch.  Basically, the "all
commits hack" is a requirement to currently have signedoff-check.sh
passing on Travis-CI.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 e6749725
......@@ -32,35 +32,4 @@ install:
- pip install -r requirements-selftests.txt
script:
- |
# First cleanup the previously installed files
PYTHON=$(which python)
$(PYTHON) setup.py develop --uninstall
BINDIR=$(dirname $(which python))
for FILE in scripts/*; do
rm $BINDIR/$(basename $FILE)
done
# Run the "make check" per each commit in PR (TRAVIS_COMMIT_RANGE)
ERR=""
echo Branch is $TRAVIS_BRANCH
if [ "$TRAVIS_PULL_REQUEST_SHA" ]; then
# It's pull request, check only PR commits
COMMITS="$(git cherry origin/master | sed -n 's/+ \(.*\)/\1/p')"
else
# push check, try to check everything
COMMITS=$(git rev-list $TRAVIS_COMMIT_RANGE)
fi
for COMMIT in $COMMITS; do
echo
echo "--------------------< $(git log -1 --oneline $COMMIT) >--------------------"
echo
echo
git checkout $COMMIT || ERR=$(echo -e "$ERR\nUnable to checkout $(git log -1 --oneline $COMMIT)")
make PYTHON=$PYTHON check || ERR=$(echo -e "$ERR\nmake check of $(git log -1 --oneline) failed")
make PYTHON=$PYTHON clean
done
if [ "$ERR" ]; then
echo
echo "Incremental smokecheck failed: $ERR"
exit -1
fi
- make check
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册