Skip to content

Commit

Permalink
[MM-61298] Fix e2e pipeline (#888)
Browse files Browse the repository at this point in the history
* Fix e2e pipeline

* We don't need ES
  • Loading branch information
streamer45 authored Oct 24, 2024
1 parent 1720eb5 commit 49c779a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ jobs:
env:
DOCKER_CLIENT_TIMEOUT: 120
COMPOSE_HTTP_TIMEOUT: 120
## Should relative to mattermost/server/build/
DOCKER_COMPOSE_FILE: gitlab-dc.postgres.yml
DOCKER_COMPOSE_FILE: ${{ github.workspace }}/e2e/docker/docker-compose.yaml
TRANSCRIBER_IMAGE_PATH: ${{ github.workspace }}/calls-transcriber.tar
run: |
mkdir -p ${{ github.workspace }}/logs
Expand Down
35 changes: 35 additions & 0 deletions e2e/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '2.4'
services:
postgres:
image: "postgres:11"
restart: always
tmpfs: /var/lib/postgresql/data
networks:
default:
aliases:
- postgres
environment:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- "./postgres.conf:/etc/postgresql/postgresql.conf"
healthcheck:
test: [ "CMD", "pg_isready", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 3

start_dependencies:
image: mattermost/mattermost-wait-for-dep:latest
depends_on:
- postgres
command: postgres:5432
networks:
default:

networks:
default:
name: ${DOCKER_NETWORK}
external: true
7 changes: 7 additions & 0 deletions e2e/docker/postgres.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
max_connections = 300
listen_addresses = '*'
fsync = off
full_page_writes = off
default_text_search_config = 'pg_catalog.english'
commit_delay=1000
logging_collector=off
6 changes: 1 addition & 5 deletions e2e/scripts/prepare-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ docker network create ${DOCKER_NETWORK}

# Start server dependencies
echo "Starting server dependencies ... "
docker compose -f ${DOCKER_COMPOSE_FILE} run -d --rm start_dependencies
DOCKER_NETWORK=${DOCKER_NETWORK} docker compose -f ${DOCKER_COMPOSE_FILE} run -d --rm start_dependencies
timeout --foreground 90s bash -c "until docker compose -f ${DOCKER_COMPOSE_FILE} exec -T postgres pg_isready ; do sleep 5 ; done"
docker compose -f ${DOCKER_COMPOSE_FILE} exec -d -T minio sh -c 'mkdir -p /data/mattermost-test'

echo "Pulling ${IMAGE_CALLS_RECORDER} in order to be quickly accessible ... "
# Pull calls-recorder image to be used by calls-offloader.
Expand Down Expand Up @@ -40,6 +39,3 @@ docker run -d --quiet --user root --name "${COMPOSE_PROJECT_NAME}_callsoffloader

# Check that calls-offloader is up and ready
docker run --rm --quiet --name "${COMPOSE_PROJECT_NAME}_curl_callsoffloader" --net ${DOCKER_NETWORK} ${IMAGE_CURL} sh -c "until curl -fs http://calls-offloader:4545/version; do echo Waiting for calls-offloader; sleep 5; done; echo calls-offloader is up"

# Check that elasticsearch is ready
docker run --rm --quiet --name "${COMPOSE_PROJECT_NAME}_curl_elasticsearch" --net ${DOCKER_NETWORK} ${IMAGE_CURL} sh -c "until curl --max-time 5 --output - http://elasticsearch:9200; do echo Waiting for elasticsearch; sleep 5; done; echo elasticsearch is up"

0 comments on commit 49c779a

Please sign in to comment.