Currently we have some license issues. We are working on it.

Unverified Commit 0fe1f26e authored by zauberstuhl's avatar zauberstuhl Committed by GitHub
Browse files


parent cbd72cc3
# Federation Tests [![](](
This repository is about automating federation tests in the network itself (see [](
This repository is about automating federation tests in the network itself!
# Layout
* [](
* [](
Every image has to accept and use following parameters:
# Add your project
Clone this repository and create a new directory:
`DATABASE` represents the name of the docker container and the database name.
`PORT` should be an unused port (check already existing container). All docker container will be executed with `--net=host` and will share the same network host. Therefore a unique port number is mandatory!
git clone
cd federation-tests && mkdir <project-name>
In this folder you have to put everything which is required for building an automated docker image.
Starting with a `Dockerfile` and a start-up script e.g. ``
The test helper will call docker like following:
The start-up script is required so that we can do some configuration magic at boot time.
docker run --name=$1 -e DATABASE=$1 -e PORT=$2 -p $2:$2 --net=host -d thefederation/$3
Starting a GangGo and Diaspora application server is then possible by writing tests like this:
Following environment variables will be available while tests are running:
$DATABASE (on every run)
$PORT (on every run)
$PRREPO (only on pull_requests from a user)
$PRSHA (only on pull_requests from a user)
This information we can use in our start-up script mentioned above.
For example if `PRREPO` and `PRSHA` is set we probably want to checkout the source code of the pull request first.
Checkout for reference the start-up script of the ganggo image:
@test "start ganggo#1 server" {
start_app "g1" "9000" "testing_ganggo:v1.0.0-ganggo"
[ "$?" -eq 0 ]
code=$(wait_for "docker logs g1" "Listening on")
echo "expected 0, got $code"
[ "$code" -eq "0" ]
@test "start diaspora#1 server" {
start_app "d1" "3000" "testing_diaspora:v1.0.3-diaspora"
[ "$?" -eq 0 ]
code=$(wait_for "docker logs d1" "Starting Diaspora in production")
echo "expected 0, got $code"
[ "$code" -eq "0" ]
# unicorn timeout
sleep 15
if [ ! -z ${PRSHA} ]; then
if [ "$(basename $PRREPO)" == "ganggo.git" ]; then
cd $repo && git stash \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
if [ "$(basename $PRREPO)" == "federation.git" ]; then
rm -r $wd && git clone $PRREPO $wd \
&& cd $wd \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot checkout $PRREPO $PRSHA"
exit 1
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf \
&& revel run
In the above example support for `` and `` was added.
If a user triggers a build with the following parameters:
The testsuite will replace the offical with the user repository and checkout the mentioned commit.
If you did all that `\m/` Create a pull-request with your changes in this repository and as soon as we merged it.
You can add your repository [here](!
Now the testing can begin :)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment