Merge pull request #1269 from Alfresco/merge-3.1/APPS-234_IntegrationTestsOnMySQL_3.1_no

Merge 3.1/apps 234 integration tests on my sql 3.1 no
This commit is contained in:
Rodica Sutu
2020-11-05 09:22:28 +02:00
committed by rodicasutu
parent eae63649ed
commit 1646e4068c
8 changed files with 81 additions and 13 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-test-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,23 @@
### 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
- docker run -d -p 61617:61617 -p 5673:5673 alfresco/alfresco-activemq:5.15.8
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 ${MVN_SKIP} -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

View File

@@ -1,14 +1,5 @@
jobs:
include:
- name: "Community Integrations Tests on MySQL"
stage: Tests
script:
- echo "Community Integrations Tests on MySQL"
- name: "Enterprise Integrations Tests on MySQL"
stage: Tests
script:
- echo "Enterprise Integrations Tests on MySQL"
- name: "Community Rest API Tests"
stage: Tests
install: