* MM-12083: unittest using externally managed database * cherry-pick Makefile changes from @cpanato * Jenkins changes (#9915) * add docker compose * udpate * when using minio dont need to set the region * update * add wait for it script * using old minio * add new jenkins file * update makefile * add dockerfile * rename the docker-compose proj to avoid colision (#9917) * rename the docker-compose proj to avoid colision * enable debug * enable debug to double checkt the branchs and fix docker-compose name (#9919) * add ee hash to check (#9920) * fix name (#9921) * update jenkins file to push from branch and prs * if a new push comes in stop the running build * split mysql and postgres variables * add script to run jenkins-like env in local dev env * update docker-compose project name to use uuid to make it more randon * fix DCNAME definition * update elasticsearch docker image * revert test * tidy up stages, and wait for mysql differently * update docker image and add check for postgres * checking if is ready * update docker compose to have a wait for deps * add readme and rename dockerfile * fix -unittest setup * using mm docker image * restore parallel unit tests at the package level Spin up a dedicated database for each package under test to avoid races in accessing the same tables. Simplify the interface for configuring the test database to just a DSN instead of multiple exports for each field. * try to work around root mysql access in CI * update local-test-env.sh too * MYSQL_ROOT_HOST: % * fix missing quotes * setting some memory limits for mysql * revert memory docker compose does not support * fix env name for postgres * expose errors in app/export_test.go * fix test label, better error checking on teardown * increase query timeout for tests * fix export_test * update local dev script * add configurable mysql root passwd
83 строки
2.0 KiB
YAML
83 строки
2.0 KiB
YAML
version: '3.4'
|
|
services:
|
|
mysql:
|
|
image: "mysql:5.7"
|
|
restart: always
|
|
container_name: mysql-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
environment:
|
|
MYSQL_ROOT_HOST: "%"
|
|
MYSQL_ROOT_PASSWORD: mostest
|
|
MYSQL_PASSWORD: mostest
|
|
MYSQL_USER: mmuser
|
|
MYSQL_DATABASE: mattermost_test
|
|
postgres:
|
|
image: "postgres:9.4"
|
|
restart: always
|
|
container_name: postgres-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
environment:
|
|
POSTGRES_USER: mmuser
|
|
POSTGRES_PASSWORD: mostest
|
|
POSTGRES_DB: mattermost_test
|
|
minio:
|
|
image: "minio/minio:RELEASE.2018-05-25T19-49-13Z"
|
|
command: "server /data"
|
|
container_name: minio-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
environment:
|
|
MINIO_ACCESS_KEY: minioaccesskey
|
|
MINIO_SECRET_KEY: miniosecretkey
|
|
inbucket:
|
|
image: "jhillyerd/inbucket:release-1.2.0"
|
|
restart: always
|
|
container_name: inbucket-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
openldap:
|
|
image: "osixia/openldap:1.1.6"
|
|
restart: always
|
|
container_name: openldap-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
environment:
|
|
LDAP_TLS_VERIFY_CLIENT: "never"
|
|
LDAP_ORGANISATION: "Mattermost Test"
|
|
LDAP_DOMAIN: "mm.test.com"
|
|
LDAP_ADMIN_PASSWORD: "mostest"
|
|
elasticsearch:
|
|
image: "mattermost/mattermost-elasticsearch-docker:6.5.1"
|
|
container_name: elasticsearch-$DCNAME-$BUILD_NUMBER
|
|
networks:
|
|
- mm-test
|
|
environment:
|
|
http.host: "0.0.0.0"
|
|
transport.host: "127.0.0.1"
|
|
ES_JAVA_OPTS: "-Xms250m -Xmx250m"
|
|
redis:
|
|
image: redis
|
|
networks:
|
|
- mm-test
|
|
container_name: redis-$DCNAME-$BUILD_NUMBER
|
|
|
|
start_dependencies:
|
|
image: mattermost/mattermost-wait-for-dep:latest
|
|
networks:
|
|
- mm-test
|
|
depends_on:
|
|
- mysql
|
|
- postgres
|
|
- minio
|
|
- inbucket
|
|
- openldap
|
|
- elasticsearch
|
|
- redis
|
|
command: postgres:5432 mysql:3306 minio:9000 inbucket:10080 openldap:389 elasticsearch:9200 redis:6379
|
|
|
|
networks:
|
|
mm-test:
|
|
driver: bridge
|