Merge remote-tracking branch 'remotes/origin/release/V2.7' into feature-3.0/APPS-234_IntegrationTestsOnMySQL_no [execute tests on MySQL]

# Conflicts:
#	.travis.env-vars.yml
#	.travis.yml
#	travis-env-vars.yml
#	travis/travis-env-vars.yml
This commit is contained in:
rodicasutu
2020-11-02 09:00:46 +02:00
parent a9b584a6ca
commit 53b642ad44
8 changed files with 79 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
import:
- source: .travis.env-vars.yml
- source: .travis.tests-stage.yml
- source: .travis.release-stage.yml
- source: .travis.publish-stage.yml
- source: travis/.travis.env-vars.yml
- source: travis/.travis.tests-stage.yml
- source: travis/.travis_integration_tests_MySQL.yml
- source: travis/.travis.release-stage.yml
- source: travis/.travis.publish-stage.yml
dist: xenial
sudo: required
language: java

10
scripts/mysql/common.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
CONTAINER_NAME=alfresco-db-mysql
MYSQL_USER=alfresco
MYSQL_ROOT_PASSWORD=alfresco
MYSQL_DATABASE=alfresco
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306

43
scripts/mysql/start.sh Normal file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
set -e
. $(dirname "${BASH_SOURCE[0]}")/common.sh
echo "============================================"
echo "Generate custom config file"
echo "============================================"
rm -rf /tmp/Docker
mkdir -p /tmp/Docker
echo "
[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
innodb_locks_unsafe_for_binlog = 1
default_storage_engine = InnoDB
max_connections = 275
lock_wait_timeout = 5
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 16M
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M
innodb_data_file_path = ibdata1:64M:autoextend
innodb_autoextend_increment = 64
init_file=/etc/mysql/conf.d/init-file.sql
" > /tmp/Docker/config-file.cnf
echo "
GRANT ALL on $MYSQL_USER.* to '$MYSQL_DATABASE'@'%' identified by '$MYSQL_ROOT_PASSWORD' with grant option;
FLUSH HOSTS;
FLUSH PRIVILEGES;
" > /tmp/Docker/init-file.sql
echo "============================================"
echo "Pulling and Running $1"
echo "============================================"
sg docker "docker run -p $MYSQL_PORT:3306 -v /tmp/Docker:/etc/mysql/conf.d --name $CONTAINER_NAME -e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD -e MYSQL_USER=$MYSQL_USER -e MYSQL_DATABASE=$MYSQL_DATABASE -d $1"
sleep 120
# The init_file option should be enough, but some old version of MariaDB do not honor it...
docker exec -t $CONTAINER_NAME mysql -v -h $MYSQL_HOST --port=$MYSQL_PORT -u root --password=$MYSQL_ROOT_PASSWORD -e "source /etc/mysql/conf.d/init-file.sql"

View File

@@ -0,0 +1,21 @@
### Integration tests on MySQL are running:
## - on stable branch
## - on demand with commit message [execute tests on MySQL]
jobs:
include:
- &integration_test_on_MYSQL
name: "Community Integrations Tests on MySQL"
services: docker
stage: Tests
if: branch =~ /(release\/.*$|master)/ OR commit_message =~ /\[execute tests on MySQL\]/
before_install: source ./scripts/mysql/start.sh mysql:5.6.26
script:
- travis_retry travis_wait 80 mvn -B -q clean install -Puse-mysql -DskipTests -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3306 -Dcommunity -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- <<: *integration_test_on_MYSQL
name: "Enterprise Integrations Tests on MySQL"
install:
- travis_retry travis_wait 60 mvn -B -q clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -f rm-community/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
script:
- travis_retry travis_wait 80 mvn -B -q clean install -Puse-mysql -DskipTests -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3306 -f rm-enterprise/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn