{"id":14110599,"url":"https://github.com/thefederationinfo/federation-tests","last_synced_at":"2025-06-26T00:06:41.023Z","repository":{"id":139505172,"uuid":"122337920","full_name":"thefederationinfo/federation-tests","owner":"thefederationinfo","description":null,"archived":false,"fork":false,"pushed_at":"2018-09-22T19:02:37.000Z","size":67,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-01T17:31:44.811Z","etag":null,"topics":["continuous-integration","diaspora","federation","federation-tests","ganggo"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thefederationinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-21T13:10:25.000Z","updated_at":"2022-11-04T01:23:54.000Z","dependencies_parsed_at":"2023-07-18T20:31:22.523Z","dependency_job_id":null,"html_url":"https://github.com/thefederationinfo/federation-tests","commit_stats":{"total_commits":51,"total_committers":2,"mean_commits":25.5,"dds":"0.019607843137254943","last_synced_commit":"5047b24aad1e593a4d1f3f6285bb36dd4fd53719"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/thefederationinfo/federation-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefederationinfo%2Ffederation-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefederationinfo%2Ffederation-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefederationinfo%2Ffederation-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefederationinfo%2Ffederation-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thefederationinfo","download_url":"https://codeload.github.com/thefederationinfo/federation-tests/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefederationinfo%2Ffederation-tests/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261973727,"owners_count":23238585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-integration","diaspora","federation","federation-tests","ganggo"],"created_at":"2024-08-14T10:02:55.308Z","updated_at":"2025-06-26T00:06:40.998Z","avatar_url":"https://github.com/thefederationinfo.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Federation Tests [![](https://travis-ci.org/thefederationinfo/federation-tests.svg?branch=master)](https://travis-ci.org/thefederationinfo/federation-tests)\n\nThis repository is about automating federation tests in the network itself!\n\n* [the-federation.info](https://the-federation.info/)\n* [testsuite.the-federation.info](https://testsuite.the-federation.info/)\n\n## Projects\n\nFollowing projects are using the testsuite:\n\n* [GangGo](https://github.com/ganggo)\n* [Socialhome](https://github.com/jaywink/socialhome)\n\n## Add your project\n\nClone this repository and create a new directory:\n\n    git clone https://github.com/thefederationinfo/federation-tests.git\n    cd federation-tests \u0026\u0026 mkdir \u003cproject-name\u003e\n \nIn this folder you have to put everything which is required for building an automated docker image.\nStarting with a `Dockerfile` and a start-up script e.g. `start.sh`\n\nThe start-up script is required so that we can do some configuration magic at boot time.\n\nFollowing environment variables will be available while tests are running:\n\n    $DATABASE (on every run)\n    $PORT     (on every run)\n    $PRREPO   (only on pull_requests from a user)\n    $PRSHA    (only on pull_requests from a user)\n\nThis information we can use in our start-up script mentioned above.  \nFor example if `PRREPO` and `PRSHA` is set we probably want to checkout the source code of the pull request first.\n\nCheckout for reference the start-up script of the ganggo image:\n\n```\n#!/bin/bash\n\nrepo=$GOPATH/src/github.com/ganggo/ganggo\nif [ ! -z ${PRSHA} ]; then\n  if [ \"$(basename $PRREPO)\" == \"ganggo.git\" ]; then\n    cd $repo \u0026\u0026 git stash \\\n      \u0026\u0026 git remote add custom $PRREPO \\\n      \u0026\u0026 git fetch custom \\\n      \u0026\u0026 git checkout $PRSHA \\\n      \u0026\u0026 git log -1 || {\n        echo \"Cannot find $PRREPO $PRSHA\"\n        exit 1\n      }\n  fi\n  if [ \"$(basename $PRREPO)\" == \"federation.git\" ]; then\n    wd=$repo/vendor/github.com/ganggo/federation\n    rm -r $wd \u0026\u0026 git clone $PRREPO $wd \\\n      \u0026\u0026 cd $wd \\\n      \u0026\u0026 git checkout $PRSHA \\\n      \u0026\u0026 git log -1 || {\n        echo \"Cannot checkout $PRREPO $PRSHA\"\n        exit 1\n      }\n  fi\nfi\n\nsed -i \"s/NAME/$DATABASE/g\" $repo/conf/app.conf \\\n  \u0026\u0026 sed -i \"s/PORT/$PORT/g\" $repo/conf/app.conf \\\n  \u0026\u0026 revel run github.com/ganggo/ganggo\n```\n\nIn the above example support for `github.com/ganggo/federation` and `github.com/ganggo/ganggo` was added.  \nIf a user triggers a build with the following parameters:\n\n    PRREPO=https://github.com/someuser/federation.git\n    PRSHA=1234567890\n\nThe testsuite will replace the offical with the user repository and checkout the mentioned commit.\n\nIf you did all that `\\m/` Create a pull-request with your changes in this repository and as soon as we merged it.  \nYou can add your repository [here](https://testsuite.the-federation.info/auth)!\n\nNow the testing can begin :)\n\n# Development\n\n## Dependencies\n\nIn case you want to test specific parts locally you need `postgresql`, `docker` and `redis`.\nMake sure they are up and running:\n\n    sudo systemctl start redis.service postgresql.service docker.service\n\nThen you can install the testsuite dependencies:\n\n* github.com/stedolan/jq\n* github.com/sstephenson/bats\n\nSimply run the install script or do it manually:\n\n    bash scripts/install.sh\n\n## Run tests\n\nAfter installing all required dependencies you can start single tests via:\n\n    # bats \u003ctest-file\u003e e.g.:\n    bats ganggo-ganggo.tx-rx.bats\n\nOr run all tests with a single command:\n\n    bats .\n\n## Run images\n\nSometimes doing tests manually helps developing a new feature. You can run single docker images by using the helper script.\nSetup the environment by executing following command once:\n\n    BATS_TEST_FILENAME=local . ./test_helper.bash\n\nThen starting can be done by executing:\n\n    # start_app \u003cdatabase-name\u003e \u003cport\u003e \"testing_\u003cproject\u003e\"$(latest_tag \u003cproject\u003e)\n    # for starting a ganggo image that could look like following:\n    start_app g1 9000 \"testing_ganggo\"$(latest_tag \"ganggo\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefederationinfo%2Ffederation-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefederationinfo%2Ffederation-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefederationinfo%2Ffederation-tests/lists"}