Merge pull request #1265 from Alfresco/feature-2.7/APPS-234_IntegrationTestsOnMySQL [execute tests on MySQL]

Feature 2.7/apps 234 integration tests on my sql
# Conflicts:
#	.travis.yml

# Conflicts:
#	.travis.yml
This commit is contained in:
Rodica Sutu
2020-11-02 07:56:35 +02:00
committed by rodicasutu
parent 07ffe9d1df
commit a13b5c98bb
5 changed files with 81 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
import:
- source: travis-env-vars.yml
- source: travis/travis-env-vars.yml
- source: travis/travis_integration_test_MySQL.yml
os: linux
dist: xenial
language: java
@@ -62,20 +64,11 @@ jobs:
script:
- travis_retry travis_wait 35 mvn -B -q clean ${MAVEN_PHASE} -Dskip.integrationtests=false -f rm-benchmark/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- 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
before_install:
- travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q
- travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_COMMUNITY_PATH/target
- travis_wait 5 bash scripts/downloadInstaller.sh $S3_COMMUNITY_INSTALLER_PATH $AUTOMATION_COMMUNITY_PATH/target
install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-community -q -f $AUTOMATION_COMMUNITY_PATH/pom.xml
script:
- travis_wait 60 mvn -B install -Prun-alfresco -Dskip.automationtests=false -f $AUTOMATION_COMMUNITY_PATH/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
@@ -84,7 +77,7 @@ jobs:
stage: Tests
before_install:
- travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q
- travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_ENTERPRISE_PATH/target
- travis_wait 5 bash scripts/downloadInstaller.sh $S3_ENTERPRISE_INSTALLER_PATH $AUTOMATION_ENTERPRISE_PATH/target
install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-enterprise -q -f $AUTOMATION_ENTERPRISE_PATH/pom.xml
script:
- travis_wait 60 mvn -B install -Prun-alfresco -Dskip.automationtests=false -f $AUTOMATION_ENTERPRISE_PATH/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
@@ -102,7 +95,7 @@ jobs:
target_paths: $TRAVIS_BUILD_NUMBER
before_install:
- travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q
- travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_UI_PATH/target
- travis_wait 5 bash scripts/downloadInstaller.sh $S3_COMMUNITY_INSTALLER_PATH $AUTOMATION_UI_PATH/target
install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-community -q -f $AUTOMATION_UI_PATH/pom.xml
script:
- travis_wait 90 xvfb-run --server-args="-screen 0 1920x1080x24" mvn -B test -Prun-alfresco -Dskip.automationtests=false -f $AUTOMATION_UI_PATH/pom.xml -DsuiteXmlFile=communitySmokeRecords.xml -Dshare.url=${SHARE_URL} -Dalfresco.url=${ALFRESCO_URL} ${WEBDRIVER_ARGUMENTS}
@@ -130,7 +123,7 @@ jobs:
target_paths: $TRAVIS_BUILD_NUMBER
before_install:
- travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q
- travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_UI_PATH/target
- travis_wait 5 bash scripts/downloadInstaller.sh $S3_ENTERPRISE_INSTALLER_PATH $AUTOMATION_UI_PATH/target
install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-enterprise -q -f $AUTOMATION_UI_PATH/pom.xml
script:
- travis_wait 90 xvfb-run --server-args="-screen 0 1920x1080x24" mvn -B test -Prun-alfresco -Dskip.automationtests=false -f $AUTOMATION_UI_PATH/pom.xml -DsuiteXmlFile=enterpriseLevel2Tests.xml -Dshare.url=${SHARE_URL} -Dalfresco.url=${ALFRESCO_URL} ${WEBDRIVER_ARGUMENTS}

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