Running make check on Ceph pull requests

Each Ceph contribution is expected to successfully run make check and pass all the unit tests it contains. The developer runs make check locally before submitting his changes but the result may be influenced by the development environment. A draft bot is proposed to watch the list of pull requests on a github repository and run a script based on each time a new patch is uploaded. --user loic-bot --password XXXXX \
   --owner ceph --repository ceph \
   --script $HOME/makecheck/

If the script fails, it adds a comment with the output of the run to the pull request. Otherwise it reports success in the same way.

The draft bot is a proof of concept based on the assumption that the github API is constantly changing and that the python library to interact with it will be obsolete because the maintainers will eventually give up. It relies on the smallest set of features to perform:

  • list all pull requests
  • get a pull request given its number
  • get the owner and repository of the head of a given pull request
  • add a comment to a pull request

The loop polls the pull requests every N seconds and runs a script after cloning the repository from which the proposed changes originates (the head). Here is the script used above:

#!/bin/bash -ex
trap "pastebinit -b output" EXIT
./ >& output
./configure --disable-static --with-radosgw \
  --with-debug CC="ccache gcc" CXX="ccache g++" \
  CFLAGS="-Wall -g" CXXFLAGS="-Wall -g" >& output
make -j8 >& output
make check >& output
make clean >& output
trap "" EXIT
echo "make check"
git remote -v | head -1
git describe

The output is stored temporarily and uploaded to a pastebin when there is a failure, to keep the message added to the pull request small.

2 Replies to “Running make check on Ceph pull requests”

  1. Once we take care of some prerequisite things related to our infrastructure, it is my hope that we can have Jenkins run validation for Ceph pull requests also 🙂

Comments are closed.