E2E Tests: unify compose files, support Opensearch (#28716)

* Unify docker-compose files, support opensearch and redis
* Support cypress/playwright bools, MM_SERVICE_OVERRIDES input
* Remove unused directives from E2E tests
* [skip ci] Fix ES tests, PR messages
* [skip ci] Fix service pruning on server restart
* [skip ci] Make services overrides a CSV, better param descriptions

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Mario Vitale
2024-10-18 16:51:24 +02:00
коммит произвёл GitHub
родитель 6af8c2f83e
Коммит 0a14eb3d45
14 изменённых файлов: 171 добавлений и 438 удалений

Просмотреть файл

@@ -1,103 +0,0 @@
version: '2.4'
services:
minio:
image: mattermostdevelopment/mirrored-minio:RELEASE.2019-10-11T00-38-09Z-1
command: "server /data"
environment:
MINIO_ACCESS_KEY: minioaccesskey
MINIO_SECRET_KEY: miniosecretkey
MINIO_SSE_MASTER_KEY: "my-minio-key:6368616e676520746869732070617373776f726420746f206120736563726574"
healthcheck:
test: [ "CMD", "nc", "-z", "-w1", "127.0.0.1", "9000" ]
interval: 10s
timeout: 15s
retries: 12
inbucket:
image: mattermostdevelopment/mirrored-inbucket:3.0.0
restart: always
environment:
INBUCKET_WEB_ADDR: "0.0.0.0:9001"
INBUCKET_POP3_ADDR: "0.0.0.0:10110"
INBUCKET_SMTP_ADDR: "0.0.0.0:10025"
healthcheck:
test: [ "CMD", "nc", "-z", "-w1", "127.0.0.1", "10025" ]
interval: 10s
timeout: 15s
retries: 12
openldap:
image: mattermostdevelopment/mirrored-openldap:1.4.0
restart: always
environment:
LDAP_TLS_VERIFY_CLIENT: "never"
LDAP_ORGANISATION: "Mattermost Test"
LDAP_DOMAIN: "mm.test.com"
LDAP_ADMIN_PASSWORD: "mostest"
healthcheck:
test: [ "CMD", "bash", "-o", "pipefail", "-c", "ss -ltn 'sport = :636' | grep -qE '^LISTEN'" ]
interval: 10s
timeout: 15s
retries: 12
elasticsearch:
image: mattermost/mattermost-elasticsearch-docker:7.17.3
environment:
http.host: "0.0.0.0"
http.port: 9200
http.cors.enabled: "true"
http.cors.allow-origin: "http://localhost:1358,http://127.0.0.1:1358"
http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
http.cors.allow-credentials: "true"
transport.host: "127.0.0.1"
ES_JAVA_OPTS: "-Xms512m -Xmx2G"
healthcheck:
test: [ "CMD", "bash", "-o", "pipefail", "-c", "curl --silent localhost:9200/_cat/health | awk '{ print $$4 }' | grep -qE '^green$$'" ]
interval: 10s
timeout: 15s
retries: 12
dejavu:
image: mattermostdevelopment/mirrored-dejavu:3.4.2
healthcheck:
test: [ "CMD", "nc", "-z", "-w1", "127.0.0.1", "1358" ]
interval: 10s
timeout: 15s
retries: 12
keycloak:
image: quay.io/keycloak/keycloak:23.0.7
restart: always
entrypoint: /opt/keycloak/bin/kc.sh start --import-realm
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HOSTNAME_STRICT: 'false'
KC_HOSTNAME_STRICT_HTTPS: 'false'
KC_HTTP_ENABLED: 'true'
JAVA_OPTS: "-Xms64m -Xmx2G -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true"
volumes:
- "./docker/keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json"
- "./docker/keycloak/kc-healthcheck.sh:/usr/local/bin/kc-healthcheck.sh"
healthcheck:
# We can't use a simple 'curl --silent localhost:9990/health | grep -q \"status\":\"UP\"' because there's no curl in the image: https://www.keycloak.org/server/health#_using_the_health_checks
test: [ "CMD", "/usr/local/bin/kc-healthcheck.sh" ]
interval: 10s
timeout: 15s
retries: 12
prometheus:
image: mattermostdevelopment/mirrored-prometheus:v2.27.1
volumes:
- "./docker/prometheus-linux.yml:/etc/prometheus/prometheus.yml"
healthcheck:
test: [ "CMD", "wget", "-q", "-O-", "127.0.0.1:9090/-/ready" ]
interval: 10s
timeout: 15s
retries: 12
# wget -q -O- localhost:3000/healthz | grep -q Ok
grafana:
image: mattermostdevelopment/mirrored-grafana:8.0.1
volumes:
- "./docker/grafana/grafana.ini:/etc/grafana/grafana.ini"
- "./docker/grafana/provisioning:/etc/grafana/provisioning"
- "./docker/grafana/dashboards:/var/lib/grafana/dashboards"
healthcheck:
test: [ "CMD", "bash", "-o", "pipefail", "-c", "wget -q -O- localhost:3000/healthz | grep -q Ok" ]
interval: 10s
timeout: 15s
retries: 12

Просмотреть файл

@@ -1,100 +0,0 @@
version: '2.4'
services:
mysql:
image: mattermostdevelopment/mirrored-mysql:8.0.32
restart: always
environment:
MYSQL_ROOT_HOST: "%"
MYSQL_ROOT_PASSWORD: mostest
MYSQL_PASSWORD: mostest
MYSQL_USER: mmuser
MYSQL_DATABASE: mattermost_test
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 10s
retries: 3
tmpfs: /var/lib/mysql
volumes:
- "./docker/mysql.conf.d:/etc/mysql/conf.d"
networks:
default:
aliases:
- mysql
minio:
extends:
file: gitlab-dc.common.yml
service: minio
networks:
default:
aliases:
- minio
inbucket:
extends:
file: gitlab-dc.common.yml
service: inbucket
networks:
default:
aliases:
- inbucket
openldap:
extends:
file: gitlab-dc.common.yml
service: openldap
networks:
default:
aliases:
- openldap
elasticsearch:
extends:
file: gitlab-dc.common.yml
service: elasticsearch
networks:
default:
aliases:
- elasticsearch
dejavu:
extends:
file: gitlab-dc.common.yml
service: dejavu
networks:
default:
aliases:
- dejavu
keycloak:
extends:
file: gitlab-dc.common.yml
service: keycloak
prometheus:
extends:
file: gitlab-dc.common.yml
service: prometheus
networks:
default:
aliases:
- prometheus
grafana:
extends:
file: gitlab-dc.common.yml
service: grafana
networks:
default:
aliases:
- grafana
start_dependencies:
image: mattermost/mattermost-wait-for-dep:latest
depends_on:
- mysql
- minio
- inbucket
- openldap
- elasticsearch
command: mysql:3306 minio:9000 inbucket:9001 openldap:389 elasticsearch:9200
networks:
default:
networks:
default:
name: ${COMPOSE_PROJECT_NAME}
external: true

Просмотреть файл

@@ -1,98 +0,0 @@
version: '2.4'
services:
postgres:
image: mattermostdevelopment/mirrored-postgres:12
restart: always
environment:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- "./docker/postgres.conf:/etc/postgresql/postgresql.conf"
healthcheck:
test: [ "CMD", "pg_isready", "-h", "localhost" ]
interval: 10s
timeout: 15s
retries: 12
networks:
default:
aliases:
- postgres
minio:
extends:
file: gitlab-dc.common.yml
service: minio
networks:
default:
aliases:
- minio
inbucket:
extends:
file: gitlab-dc.common.yml
service: inbucket
networks:
default:
aliases:
- inbucket
openldap:
extends:
file: gitlab-dc.common.yml
service: openldap
networks:
default:
aliases:
- openldap
elasticsearch:
extends:
file: gitlab-dc.common.yml
service: elasticsearch
networks:
default:
aliases:
- elasticsearch
dejavu:
extends:
file: gitlab-dc.common.yml
service: dejavu
networks:
default:
aliases:
- dejavu
keycloak:
extends:
file: gitlab-dc.common.yml
service: keycloak
prometheus:
extends:
file: gitlab-dc.common.yml
service: prometheus
networks:
default:
aliases:
- prometheus
grafana:
extends:
file: gitlab-dc.common.yml
service: grafana
networks:
default:
aliases:
- grafana
start_dependencies:
image: mattermost/mattermost-wait-for-dep:latest
depends_on:
- postgres
- minio
- inbucket
- openldap
- elasticsearch
command: postgres:5432 minio:9000 inbucket:9001 openldap:389 elasticsearch:9200
networks:
default:
networks:
default:
name: ${COMPOSE_PROJECT_NAME}
external: true

Просмотреть файл

@@ -1,36 +0,0 @@
version: '2.4'
services:
mysql:
image: mattermostdevelopment/mirrored-mysql:8.0.32
restart: always
environment:
MYSQL_ROOT_HOST: "%"
MYSQL_ROOT_PASSWORD: mostest
MYSQL_PASSWORD: mostest
MYSQL_USER: mmuser
MYSQL_DATABASE: mattermost_test
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 10s
retries: 3
tmpfs: /var/lib/mysql
volumes:
- "./docker/mysql.conf.d:/etc/mysql/conf.d"
networks:
default:
aliases:
- mysql
start_dependencies:
image: mattermost/mattermost-wait-for-dep:latest
depends_on:
- mysql
command: mysql:3306
networks:
default:
networks:
default:
name: ${COMPOSE_PROJECT_NAME}
external: true

Просмотреть файл

@@ -1,34 +0,0 @@
version: '2.4'
services:
postgres:
image: mattermostdevelopment/mirrored-postgres:12
restart: always
environment:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- "./docker/postgres.conf:/etc/postgresql/postgresql.conf"
healthcheck:
test: [ "CMD", "pg_isready", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 3
networks:
default:
aliases:
- postgres
start_dependencies:
image: mattermost/mattermost-wait-for-dep:latest
depends_on:
- postgres
command: postgres:5432
networks:
default:
networks:
default:
name: ${COMPOSE_PROJECT_NAME}
external: true