view docker/docker-compose_e2e.yml @ 3415:814e118d9ef3

tests: end-2-end tests first draft: - e2e tests are launched inside the new docker e2e test environment - `run_e2e.py` launch the docker container, mount the current code base in it, launch the e2e tests and print report in real time - `conftest.py` are pytest fixtures managing many things such as account creation, fake files management, JSON or Domish.Element parsing, fake editor, etc. - `test_jp.py` are end-to-end test done with `jp`. `sh` library is used to make tests writting as user-friendly as possible. The `SAT_TEST_ENV_E2E` environment variable is checked, and tests will be skipped if it's not set.
author Goffi <goffi@goffi.org>
date Thu, 12 Nov 2020 14:53:16 +0100
parents b3e7e3c49d8f
children 0653be94ee5e
line wrap: on
line source

version: "3.6"
services:

  prosody:
    build: prosody_e2e
    image: salutatoi/prosody_e2e
    depends_on:
      # we need to depend on sat to get IP address of the container for conf
      - sat
    tmpfs: /var/lib/prosody
    tmpfs: /var/log/prosody
    networks:
      default:
        aliases:
          - server1.test
          - server2.test
          - server3.test

  db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: test_e2e
      POSTGRES_DB: pubsub
    tmpfs: /var/lib/postgresql/data

  pubsub:
    build: pubsub
    image: salutatoi/sat_pubsub
    depends_on:
      - db
      - prosody
    environment:
      PGHOST: db
      PGUSER: postgres
      PGPASSWORD: test_e2e
      SAT_PUBSUB_RHOST: server1.test
      SAT_PUBSUB_JID: pubsub.server1.test
      SAT_PUBSUB_XMPP_PWD: test_e2e

  sat:
    build: backend_e2e
    image: salutatoi/sat_e2e
    environment:
      SAT_TEST_ENV_E2E: "1"
    networks:
      default:
        aliases:
          - sat.test