From 2655a8cc3b0344e19d11b9b4960ee052584e8982 Mon Sep 17 00:00:00 2001 From: alandavis Date: Wed, 5 May 2021 21:07:01 +0100 Subject: [PATCH] Apps 937 Run AGS community tests (#407) [skip tests] * APPS-937 execute AGS tests [skip tests] * APPS-937 Added missing file [ags][ags on MySQL][skip db][no downstream] * APPS-937 tests postgres 13.1 [ags][skip db][no downstream] * APPS-937 code review comments [skip tests] (cherry picked from commit 66eda8dcccdcb7ce4623abae25d5ba9e6a13c39a) --- .travis.yml | 26 ++++- amps/ags/pom.xml | 9 +- amps/ags/rm-automation/pom.xml | 16 --- .../rm-automation-community-rest-api/pom.xml | 2 - .../requests/gscore/api/RMSiteAPI.java | 6 +- .../rm-community-repo/docker-compose.yml | 6 +- .../rm-community/rm-community-repo/pom.xml | 102 ++++++++++++++++-- scripts/travis/cleanup_cache.sh | 1 + 8 files changed, 126 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index 798ccdbfd4..285af17cf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ env: global: - TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts - TAS_ENVIRONMENT=./packaging/tests/environment + - LOG_WARN="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" stages: - name: test @@ -278,9 +279,28 @@ jobs: - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" script: travis_wait 30 mvn -B install -f packaging/tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false - - name: "AGS Unit & Integration Tests" - if: branch = master OR commit_message =~ /\[ags\]/ - script: travis_retry travis_wait mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pstart-db -f amps/ags/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + - name: "AGS Unit & Integration Tests (PostgreSQL)" + if: branch =~ /(release\/.*$|master)/ OR commit_message =~ /\[ags\]/ + script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pstart-postgres -f amps/ags/pom.xml ${LOG_WARN} + + - name: "AGS Unit & Integration Tests (MySQL) " + if: branch =~ /(release\/.*$|master)/ OR commit_message =~ /\[ags on MySQL\]/ + script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pstart-mysql -f amps/ags/pom.xml ${LOG_WARN} + + - name: "AGS Community Rest API Tests" + if: branch =~ /(release\/.*$|master)/ OR commit_message =~ /\[ags\]/ + addons: + artifacts: + paths: + - ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log + - alfresco.log + - solr.log + target_paths: ${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER} + before_script: + - ${TAS_SCRIPTS}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml + - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" + script: travis_wait 40 mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false + after_script: bash amps/ags/travis/scripts/getLogs.sh - name: "Push to Nexus" stage: release diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 64d1c92d79..8bfa7f0618 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -29,7 +29,6 @@ 0.0 - 5.15.8 61616 5672 3.7.0 @@ -53,12 +52,6 @@ 2.12.1 0.34.1 1.10.19 - 42.2.16 - 5432 - 5.1.40 - 3306 - - 5431 UTF-8 UTF-8 @@ -112,7 +105,7 @@ mysql mysql-connector-java - ${mysql.version} + ${dependency.mysql.version} diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 43def161a3..4ade32c99c 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -27,22 +27,6 @@ - - maven-antrun-plugin - - - default-cli - - - Stopping Alfresco... - - - - - - - - maven-surefire-plugin diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index a012644fcc..896d7a3b1c 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -12,8 +12,6 @@ false - alfresco-governance-services-community-share - alfresco-governance-services-community-repo 2.0.0 2.7.9.1 diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/RMSiteAPI.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/RMSiteAPI.java index a96e450030..383a93cfde 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/RMSiteAPI.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/RMSiteAPI.java @@ -81,7 +81,7 @@ public class RMSiteAPI extends RMModelRequest /** * Create the RM site * - * @param rmSite The properties of the rm site to be created + * @param rmSiteModel The properties of the rm site to be created * @return The {@link RMSite} with the given properties * @throws RuntimeException for the following cases: *
    @@ -124,7 +124,7 @@ public class RMSiteAPI extends RMModelRequest /** * Update RM site * - * @param rmSiteProperties The properties to be updated + * @param rmSiteModel The properties to be updated * @return The updated {@link RMSite} * @throws RuntimeException for the following cases: *
      @@ -161,6 +161,6 @@ public class RMSiteAPI extends RMModelRequest public boolean existsRMSite() { getSite(); - return getRmRestWrapper().getStatusCode().equals(OK.toString()); + return getRmRestWrapper().getStatusCode().equals(String.valueOf(OK.value())); } } diff --git a/amps/ags/rm-community/rm-community-repo/docker-compose.yml b/amps/ags/rm-community/rm-community-repo/docker-compose.yml index bac5396290..bdd8d01456 100644 --- a/amps/ags/rm-community/rm-community-repo/docker-compose.yml +++ b/amps/ags/rm-community/rm-community-repo/docker-compose.yml @@ -24,7 +24,7 @@ services: -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco - -Dsolr.host=solr6 + -Dsolr.host=search -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr @@ -57,14 +57,14 @@ services: ports: - 5432:5432 - solr6: + search: image: alfresco/alfresco-search-services:${SOLR6_TAG} environment: #Solr needs to know how to register itself with Alfresco - SOLR_ALFRESCO_HOST=alfresco - SOLR_ALFRESCO_PORT=8080 #Alfresco needs to know how to call solr - - SOLR_SOLR_HOST=solr6 + - SOLR_SOLR_HOST=search - SOLR_SOLR_PORT=8983 #Create the default alfresco and archive cores - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index 1853473192..1da191248d 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -19,6 +19,15 @@ alfresco localhost alfresco-test + + 5.7.23 + 3306 + 3307 + + 5432 + + 5431 + alfresco-platform 9.1-901.jdbc4 alfresco-governance-services-community-repo @@ -264,9 +273,9 @@ - ${alfresco.test.db.name} - org.postgresql.Driver - jdbc:postgresql://localhost:${database.port}/${alfresco.test.db.name} + ${db.name} + ${alfresco.db.datasource.class} + ${alfresco.db.url} ${project.build.directory}/alf-data-test @@ -465,8 +474,16 @@ + - start-db + start-postgres + + ${alfresco.test.db.name} + ${postgresql.tests.port} + jdbc:postgresql://${alfresco.db.host}:${alfresco.db.port}/${db.name} + jdbc:postgresql://${alfresco.db.host}:${alfresco.db.port}/${db.name} + org.postgresql.Driver + @@ -480,7 +497,7 @@ - ${database.port}:${postgresql.port} + ${postgresql.tests.port}:${postgresql.port} ${alfresco.db.password} @@ -529,6 +546,77 @@ + + + start-mysql + + ${alfresco.db.name} + ${mysql.tests.port} + jdbc:mysql://${alfresco.db.host}:${alfresco.db.port}/${db.name} + jdbc:mysql://${alfresco.db.host}:${alfresco.db.port}/${db.name} + com.mysql.cj.jdbc.Driver + + + + + io.fabric8 + docker-maven-plugin + + + + mysql:${mysql.version} + + + ${mysql.tests.port}:${mysql.port} + + + ${alfresco.db.password} + ${alfresco.db.password} + ${alfresco.db.username} + ${alfresco.db.name} + + + --transaction-isolation=READ-COMMITTED + + + mysqld: ready for connections + + + + + + alfresco/alfresco-activemq:${dependency.activemq.version} + + + ${activemq.port1}:${activemq.port1} + ${activemq.port2}:${activemq.port2} + + + + + + + + before-integration-tests + pre-integration-test + + stop + start + + + + after-integration-tests + post-integration-test + + stop + + + + + + + + start-repo @@ -622,7 +710,7 @@ mysql mysql-connector-java - ${mysql.version} + ${dependency.mysql.version} @@ -653,7 +741,7 @@ mysql mysql-connector-java - ${mysql.version} + ${dependency.mysql.version} diff --git a/scripts/travis/cleanup_cache.sh b/scripts/travis/cleanup_cache.sh index 33b940e2cd..e7439e121b 100644 --- a/scripts/travis/cleanup_cache.sh +++ b/scripts/travis/cleanup_cache.sh @@ -16,4 +16,5 @@ rm -rf "${HOME}/.m2/repository/org/alfresco/content-services*" rm -rf "${HOME}/.m2/repository/org/alfresco/content-services-community" rm -rf "${HOME}/.m2/repository/org/alfresco/tas/alfresco-community-repo-*-test" rm -rf "${HOME}/.m2/repository/org/alfresco/tas/alfresco-enterprise-repo-*-test" +rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-governance-services*"