Browse Source

Implement integration test for federation

pull/269/head
Felix 2 years ago
parent
commit
231388f3a7
  1. 1
      .dockerignore
  2. 1
      .gitignore
  3. 23
      docker/federation-test/run-tests.sh
  4. 3
      docker/federation/docker-compose.yml
  5. 2
      docker/federation/run-federation-test.bash

1
.dockerignore

@ -3,6 +3,7 @@ ui/node_modules
server/target
docker/dev/volumes
docker/federation/volumes
docker/federation-test/volumes
.git
ansible

1
.gitignore

@ -7,6 +7,7 @@ ansible/passwords/
docker/lemmy_mine.hjson
docker/dev/env_deploy.sh
docker/federation/volumes
docker/federation-test/volumes
docker/dev/volumes
# local build files

23
docker/federation-test/run-tests.sh

@ -0,0 +1,23 @@
#!/bin/bash
set -e
pushd ../../server/
cargo build
popd
sudo docker build ../../ --file ../federation/Dockerfile --tag lemmy-federation:latest
sudo docker-compose --file ../federation/docker-compose.yml --project-directory . up -d
# TODO: need to wait until the instances are initialised
pushd ../../ui
yarn
echo "Waiting for Lemmy to start..."
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8540/api/v1/site')" != "200" ]]; do sleep 5; done
yarn api-test || true
popd
sudo docker-compose --file ../federation/docker-compose.yml --project-directory . down
sudo rm -r volumes/

3
docker/federation/docker-compose.yml

@ -7,7 +7,8 @@ services:
- "8540:8540"
- "8550:8550"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# Hack to make this work from both docker/federation/ and docker/federation-test/
- ../federation/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- lemmy_alpha
- pictshare_alpha

2
docker/federation/run-federation-test.bash

@ -12,6 +12,6 @@ pushd ../../server/ || exit
cargo build
popd || exit
sudo docker build ../../ -f Dockerfile -t lemmy-federation:latest
sudo docker build ../../ --file Dockerfile -t lemmy-federation:latest
sudo docker-compose up
Loading…
Cancel
Save