mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
APPS-261 Initial setup for WORM test automation
This commit is contained in:
@@ -61,6 +61,14 @@ jobs:
|
||||
script:
|
||||
- travis_retry travis_wait 35 mvn -B -q ${MAVEN_PHASE} -Dskip.integrationtests=false -f rm-benchmark/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
|
||||
- name: "Enterprise WORM automated Tests"
|
||||
stage: tests
|
||||
before_install: bash scripts/init.sh
|
||||
script: bash scripts/worm-mb-tests.sh
|
||||
# after_script: bash _ci/cleanup.sh
|
||||
- echo "Enterprise WORM automated Tests"
|
||||
|
||||
|
||||
- name: "Community Integrations Tests on MySQL"
|
||||
stage: Tests
|
||||
script:
|
||||
|
18
scripts/init.sh
Normal file
18
scripts/init.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting Init Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
mkdir -p ${HOME}/.m2 && cp -rf _ci/settings.xml ${HOME}/.m2/
|
||||
echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" --password-stdin quay.io
|
||||
find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||
|
||||
# Enable experimental docker features (e.g. squash options)
|
||||
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
||||
sudo service docker restart
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Init Script =========================="
|
58
scripts/start-compose.sh
Normal file
58
scripts/start-compose.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export DOCKER_COMPOSE_PATH=$1
|
||||
|
||||
if [ -z "$DOCKER_COMPOSE_PATH" ]
|
||||
then
|
||||
echo "Please provide path to docker-compose.yml: \"${0##*/} /path/to/docker-compose.yml\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fix uppercase bucket name if set
|
||||
if [ -n "${S3_BUCKET_NAME}" ]
|
||||
then
|
||||
export S3_BUCKET_NAME="${S3_BUCKET_NAME,,}"
|
||||
fi
|
||||
|
||||
export DOCKER_COMPOSE_PATH=$1
|
||||
|
||||
if [ -z "$DOCKER_COMPOSE_PATH" ]
|
||||
then
|
||||
echo "Please provide path to docker-compose.yml: \"${0##*/} /path/to/docker-compose.yml\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting AGS stack in ${DOCKER_COMPOSE_PATH}"
|
||||
|
||||
# .env files are picked up from project directory correctly on docker-compose 1.23.0+
|
||||
docker-compose --file "${DOCKER_COMPOSE_PATH}" --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") up -d
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Docker Compose started ok"
|
||||
else
|
||||
echo "Docker Compose failed to start" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WAIT_INTERVAL=1
|
||||
COUNTER=0
|
||||
TIMEOUT=300
|
||||
t0=`date +%s`
|
||||
|
||||
echo "Waiting for alfresco to start"
|
||||
until $(curl --output /dev/null --silent --head --fail http://localhost:8080/alfresco) || [ "$COUNTER" -eq "$TIMEOUT" ]; do
|
||||
printf '.'
|
||||
sleep $WAIT_INTERVAL
|
||||
COUNTER=$(($COUNTER+$WAIT_INTERVAL))
|
||||
done
|
||||
|
||||
if (("$COUNTER" < "$TIMEOUT")) ; then
|
||||
t1=`date +%s`
|
||||
delta=$((($t1 - $t0)/60))
|
||||
echo "Alfresco Started in $delta minutes"
|
||||
else
|
||||
echo "Waited $COUNTER seconds"
|
||||
echo "Alfresco Could not start in time."
|
||||
exit 1
|
||||
fi
|
19
scripts/stop-compose.sh
Normal file
19
scripts/stop-compose.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export DOCKER_COMPOSE_PATH=$1
|
||||
|
||||
if [ -z "$DOCKER_COMPOSE_PATH" ]
|
||||
then
|
||||
echo "Please provide path to docker-compose.yml: \"${0##*/} /path/to/docker-compose.yml\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Killing ACS stack in ${DOCKER_COMPOSE_PATH}"
|
||||
|
||||
cd ${DOCKER_COMPOSE_PATH}
|
||||
|
||||
docker-compose ps
|
||||
# logs for debug
|
||||
docker-compose logs --no-color -t alfresco
|
||||
docker-compose kill
|
||||
docker-compose rm -fv
|
35
scripts/worm-mb-tests.sh
Normal file
35
scripts/worm-mb-tests.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting Integration Tests Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
export AWS_ACCESS_KEY_ID=${CREATE_BUCKET_AWS_ACCESS_KEY}
|
||||
export AWS_SECRET_ACCESS_KEY=${CREATE_BUCKET_AWS_SECRET_KEY}
|
||||
|
||||
export BUCKET_NAME="travis-ags-worm-${TRAVIS_BUILD_NUMBER}-${TRAVIS_JOB_NUMBER}"
|
||||
export BUCKET2_NAME="travis-ags-worm-${TRAVIS_BUILD_NUMBER}-${TRAVIS_JOB_NUMBER}-b2"
|
||||
|
||||
export S3_BUCKET_REGION="eu-west-1"
|
||||
export S3_BUCKET_NAME="${BUCKET_NAME}"
|
||||
export S3_BUCKET2_NAME="${BUCKET2_NAME}"
|
||||
export S3_PROTOCOL=s3v2
|
||||
export S3_BUCKET2_PROTOCOL=s3vTest
|
||||
|
||||
mvn -B -U clean install -DskipTests -Pbuild-test-image
|
||||
|
||||
./scripts/start-compose.sh ./rm-enterprise/rm-enterprise-share/worm-support-docker-compose.yml
|
||||
|
||||
# Run the WORM tests
|
||||
# mvn -B -U clean test \
|
||||
# -Prun-tas-tests,run-multiple-buckets-tests \
|
||||
# -Denvironment=default \
|
||||
# -DrunBugs=false \
|
||||
# -Dalfresco.port=8080 \
|
||||
# -Dconnector.s3.bucketName=${BUCKET_NAME2}
|
||||
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Integration Tests Script =========================="
|
Reference in New Issue
Block a user