From 2723817832b0d8c715ddf2b853c4062187080175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20=C5=9Awi=C4=99to=C5=84?= Date: Wed, 3 Apr 2024 09:46:01 +0200 Subject: [PATCH] ACS-6309 Integration with Report Portal (#2445) --- .github/workflows/ci.yml | 542 +++++++++++++++++- .../rm-automation-community-rest-api/pom.xml | 10 + .../services/org.testng.ITestNGListener | 1 + .../rm-community/rm-community-repo/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + .../services/org.testng.ITestNGListener | 1 + amps/share-services/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + core/pom.xml | 12 + core/src/test/java/AllCoreUnitTestSuite.java | 59 ++ .../services/org.testng.ITestNGListener | 1 + data-model/pom.xml | 5 + .../alfresco/AllDataModelUnitTestSuite.java | 64 +++ .../services/org.testng.ITestNGListener | 1 + mmt/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + packaging/tests/tas-cmis/pom.xml | 10 + .../services/org.testng.ITestNGListener | 1 + packaging/tests/tas-email/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + packaging/tests/tas-integration/pom.xml | 12 + .../services/org.testng.ITestNGListener | 1 + packaging/tests/tas-restapi/pom.xml | 12 + .../services/org.testng.ITestNGListener | 1 + packaging/tests/tas-webdav/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + pom.xml | 12 + remote-api/pom.xml | 5 + .../services/org.testng.ITestNGListener | 1 + repository/pom.xml | 5 + .../camel/MessagingUnitTestSuite.java | 38 ++ .../services/org.testng.ITestNGListener | 1 + scripts/ci/add_step_summary.sh | 17 + 33 files changed, 825 insertions(+), 17 deletions(-) create mode 100644 amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 amps/ags/rm-community/rm-community-repo/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 amps/ags/rm-community/rm-community-repo/unit-test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 amps/share-services/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 core/src/test/java/AllCoreUnitTestSuite.java create mode 100644 core/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 data-model/src/test/java/org/alfresco/AllDataModelUnitTestSuite.java create mode 100644 data-model/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 mmt/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 packaging/tests/tas-cmis/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 packaging/tests/tas-email/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 packaging/tests/tas-integration/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 packaging/tests/tas-restapi/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 packaging/tests/tas-webdav/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 remote-api/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 repository/src/test/java/org/alfresco/messaging/camel/MessagingUnitTestSuite.java create mode 100644 repository/src/test/resources/META-INF/services/org.testng.ITestNGListener create mode 100644 scripts/ci/add_step_summary.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7ca84bcbc..9c7fec53d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,9 @@ env: AUTH0_CLIENT_ID: ${{ secrets.AUTH0_OIDC_ADMIN_CLIENT_ID }} AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_OIDC_CLIENT_SECRET }} AUTH0_ADMIN_PASSWORD: ${{ secrets.AUTH0_OIDC_ADMIN_PASSWORD }} + # Report Portal settings + RP_LAUNCH_PREFIX: "${{ github.workflow }} - ${{ github.job }}" + RP_PROJECT: alfresco-backend jobs: prepare: @@ -142,13 +145,29 @@ jobs: classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\"" all_unit_tests_suite: - name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" + name: ${{ matrix.testName }} - AllUnitTestsSuite - Build and test runs-on: ubuntu-latest needs: [prepare] if: > !contains(github.event.head_commit.message, '[skip repo]') && !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') + strategy: + fail-fast: false + matrix: + include: + - testName: Core + testModule: core + testAttributes: "-Dtest=AllCoreUnitTestSuite" + - testName: Data-Model + testModule: data-model + testAttributes: "-Dtest=AllDataModelUnitTestSuite" + - testName: Repository + testModule: repository + testAttributes: "-Dtest=AllUnitTestsSuite" + - testName: Mmt + testModule: mmt + testAttributes: "-Dtest=AllMmtUnitTestSuite" steps: - uses: actions/checkout@v3 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 @@ -156,10 +175,44 @@ jobs: - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 - name: "Init" run: bash ./scripts/ci/init.sh + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testModule }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} run: | - mvn -B test -pl core,data-model -am -DfailIfNoTests=false - mvn -B test -pl "repository,mmt" -am "-Dtest=AllUnitTestsSuite,AllMmtUnitTestSuite" -DfailIfNoTests=false + eval "args=($RP_OPTS)" + mvn -B test -pl ${{ matrix.testModule }} -am ${{ matrix.testAttributes }} -DfailIfNoTests=false "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -201,8 +254,44 @@ jobs: run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testSuite }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -232,8 +321,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d env: MARIADB_VERSION: ${{ matrix.version }} + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.version }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -259,8 +384,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d env: MARIADB_VERSION: 10.6 + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -286,8 +447,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d env: MYSQL_VERSION: 8 + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -312,8 +509,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 13.12 + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -338,8 +571,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 14.9 + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -364,8 +633,44 @@ jobs: run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 15.4 + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -386,8 +691,44 @@ jobs: run: bash ./scripts/ci/init.sh - name: "Run ActiveMQ" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.13.1 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=MessagingUnitTestSuite -DfailIfNoTests=false "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.13.1 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -457,8 +798,44 @@ jobs: fi - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testSuite }} ${{ matrix.idp }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }} + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }} "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -519,16 +896,51 @@ jobs: - name: "Build TAS integration tests" if: ${{ matrix.test-name }} == 'Integration TAS tests' run: mvn install -pl :alfresco-community-repo-integration-test -am -DskipTests -Pall-tas-tests + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.test-name }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" id: tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn -B verify -f packaging/tests/${{ matrix.pom-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false + run: | + eval "args=($RP_OPTS)" + mvn -B verify -f packaging/tests/${{ matrix.pom-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false "${args[@]}" + continue-on-error: true - name: "Print output after success" if: ${{ always() && steps.tests.outcome == 'success' }} run: ${TAS_SCRIPTS}/output_tests_run.sh "packaging/tests/${{ matrix.pom-dir }}" - name: "Print output after failure" if: ${{ always() && steps.tests.outcome == 'failure' }} run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "packaging/tests/${{ matrix.pom-dir }}" + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.tests.outcome != 'success' + run: | + echo "::error title=tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -549,8 +961,44 @@ jobs: run: bash ./scripts/ci/init.sh - name: "Run Postgres 15.4 database" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Run tests" - run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + id: run-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -580,9 +1028,21 @@ jobs: run: | bash ./scripts/ci/init.sh bash ./scripts/ci/build.sh + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} 0${{ matrix.part }} - (PostgreSQL) ${{ matrix.test-name }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true - name: "Verify" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} "${args[@]}" - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -612,9 +1072,21 @@ jobs: run: | bash ./scripts/ci/init.sh bash ./scripts/ci/build.sh + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} 0${{ matrix.part }} - (MySQL) ${{ matrix.test-name }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true - name: "Verify" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} "${args[@]}" - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -646,9 +1118,45 @@ jobs: ${{ env.TAS_SCRIPTS }}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" mvn -B install -pl :alfresco-governance-services-automation-community-rest-api -am -Pags -Pall-tas-tests -DskipTests + - name: "Prepare Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v5.1.0 + id: rp-prepare + with: + rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + rp-project: ${{ env.RP_PROJECT }} + rp-use-static-launch-name: true + - name: "Add GitHub Step Summary" + env: + RP_ENABLED: ${{ steps.rp-prepare.outputs.enabled }} + RP_KEY: ${{ steps.rp-prepare.outputs.key }} + RP_URL: ${{ steps.rp-prepare.outputs.url }} + run: bash scripts/ci/add_step_summary.sh - name: "Test" + id: run-tests timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false -Pags -Pall-tas-tests + env: + RP_OPTS: ${{ steps.rp-prepare.outputs.mvn-opts }} + run: | + eval "args=($RP_OPTS)" + mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false -Pags -Pall-tas-tests "${args[@]}" + continue-on-error: true + - name: "Update GitHub Step Summary" + run: | + echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY + - name: "Summarize Report Portal" + uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v5.1.0 + id: rp-summarize + with: + tests-outcome: ${{ steps.run-tests.outcome }} + rp-launch-key: ${{ steps.rp-prepare.outputs.key }} + rp-project: ${{ env.RP_PROJECT }} + rp-token: ${{ secrets.REPORT_PORTAL_TOKEN }} + - name: "Exit on failure" + if: steps.run-tests.outcome != 'success' + run: | + echo "::error title=run-tests::Tests failed: re-throwing on error." + exit 1 - name: "Configure AWS credentials" if: ${{ always() }} uses: aws-actions/configure-aws-credentials@v1 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 5c9fb56705..117d9c23f4 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 @@ -74,6 +74,16 @@ alfresco-testng 1.1 + + com.epam.reportportal + agent-java-testng + test + + + com.squareup.okhttp3 + okhttp + test + org.apache.commons commons-collections4 diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/META-INF/services/org.testng.ITestNGListener b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index ae99f00ee7..a2f15329f2 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -84,6 +84,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.postgresql postgresql diff --git a/amps/ags/rm-community/rm-community-repo/test/resources/META-INF/services/org.testng.ITestNGListener b/amps/ags/rm-community/rm-community-repo/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/amps/ags/rm-community/rm-community-repo/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/amps/ags/rm-community/rm-community-repo/unit-test/resources/META-INF/services/org.testng.ITestNGListener b/amps/ags/rm-community/rm-community-repo/unit-test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/amps/ags/rm-community/rm-community-repo/unit-test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index b77d1384ab..25dc53f055 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -70,6 +70,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.postgresql postgresql diff --git a/amps/share-services/src/test/resources/META-INF/services/org.testng.ITestNGListener b/amps/share-services/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/amps/share-services/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/core/pom.xml b/core/pom.xml index 9d5bcb45d6..2e18710c86 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -126,6 +126,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.mockito mockito-core @@ -158,6 +163,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipCoreTests} + + diff --git a/core/src/test/java/AllCoreUnitTestSuite.java b/core/src/test/java/AllCoreUnitTestSuite.java new file mode 100644 index 0000000000..c6a0a3bd74 --- /dev/null +++ b/core/src/test/java/AllCoreUnitTestSuite.java @@ -0,0 +1,59 @@ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2024 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco; + +import org.junit.experimental.categories.Categories; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Categories.class) +@Suite.SuiteClasses({ + org.alfresco.config.SystemPropertiesSetterBeanTest.class, + org.alfresco.encryption.AlfrescoKeyStoreTest.class, + org.alfresco.encryption.EncryptingOutputStreamTest.class, + org.alfresco.error.AlfrescoRuntimeExceptionTest.class, + org.alfresco.query.CannedQueryTest.class, + org.alfresco.util.BridgeTableTest.class, + org.alfresco.util.CachingDateFormatTest.class, + org.alfresco.util.DynamicallySizedThreadPoolExecutorTest.class, + org.alfresco.util.EqualsHelperTest.class, + org.alfresco.util.GuidTest.class, + org.alfresco.util.ISO8601DateFormatTest.class, + org.alfresco.util.LogAdapterTest.class, + org.alfresco.util.LogTeeTest.class, + org.alfresco.util.PathMapperTest.class, + org.alfresco.util.TempFileProviderTest.class, + org.alfresco.util.VersionNumberTest.class, + org.alfresco.util.collections.CollectionUtilsTest.class, + org.alfresco.util.exec.ExecParameterTokenizerTest.class, + org.alfresco.util.exec.RuntimeExecBeansTest.class, + org.alfresco.util.exec.RuntimeExecTest.class, + org.alfresco.util.random.NormalDistributionHelperTest.class, + org.alfresco.util.shard.ExplicitShardingPolicyTest.class, + org.alfresco.util.transaction.SpringAwareUserTransactionTest.class +}) +public class AllCoreUnitTestSuite { +} diff --git a/core/src/test/resources/META-INF/services/org.testng.ITestNGListener b/core/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/core/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/data-model/pom.xml b/data-model/pom.xml index 8ac82e5acd..5700799327 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -235,6 +235,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.antlr gunit diff --git a/data-model/src/test/java/org/alfresco/AllDataModelUnitTestSuite.java b/data-model/src/test/java/org/alfresco/AllDataModelUnitTestSuite.java new file mode 100644 index 0000000000..11cec3d546 --- /dev/null +++ b/data-model/src/test/java/org/alfresco/AllDataModelUnitTestSuite.java @@ -0,0 +1,64 @@ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2024 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco; + +import org.junit.experimental.categories.Categories; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Categories.class) +@Suite.SuiteClasses({ + org.alfresco.opencmis.dictionary.CMISAbstractDictionaryServiceTest.class, + org.alfresco.repo.content.MimetypeMapTest.class, + org.alfresco.repo.content.encoding.CharsetFinderTest.class, + org.alfresco.repo.dictionary.AbstractModelTest.class, + org.alfresco.repo.dictionary.DictionaryComponentTest.class, + org.alfresco.repo.dictionary.DictionaryDAOTest.class, + org.alfresco.repo.dictionary.DiffModelTest.class, + org.alfresco.repo.dictionary.constraint.ConstraintsTest.class, + org.alfresco.repo.index.ShardMethodEnumTest.class, + org.alfresco.repo.search.impl.parsers.CMISTest.class, + org.alfresco.repo.search.impl.parsers.CMIS_FTSTest.class, + org.alfresco.repo.search.impl.parsers.FTSTest.class, + org.alfresco.repo.security.authentication.InMemoryTicketComponentTest.class, + org.alfresco.service.cmr.repository.MLTextTest.class, + org.alfresco.service.cmr.repository.NodeRefTest.class, + org.alfresco.service.cmr.repository.PathTest.class, + org.alfresco.service.cmr.repository.PeriodTest.class, + org.alfresco.service.cmr.repository.datatype.DefaultTypeConverterTest.class, + org.alfresco.service.cmr.search.StatsProcessorTest.class, + org.alfresco.service.namespace.DynamicNameSpaceResolverTest.class, + org.alfresco.service.namespace.QNamePatternTest.class, + org.alfresco.service.namespace.QNameTest.class, + org.alfresco.util.ConfigFileFinderTest.class, + org.alfresco.util.ConfigSchedulerTest.class, + org.alfresco.util.ISO9075Test.class, + org.alfresco.util.NumericEncodingTest.class, + org.alfresco.util.SearchDateConversionTest.class, + org.alfresco.util.SearchLanguageConversionTest.class +}) +public class AllDataModelUnitTestSuite { +} diff --git a/data-model/src/test/resources/META-INF/services/org.testng.ITestNGListener b/data-model/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/data-model/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/mmt/pom.xml b/mmt/pom.xml index 47823be4ff..e5f91b215d 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -46,6 +46,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.mockito mockito-core diff --git a/mmt/src/test/resources/META-INF/services/org.testng.ITestNGListener b/mmt/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/mmt/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index ed53544185..8a408ca165 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -68,6 +68,16 @@ + + com.epam.reportportal + agent-java-testng + test + + + com.squareup.okhttp3 + okhttp + test + diff --git a/packaging/tests/tas-cmis/src/test/resources/META-INF/services/org.testng.ITestNGListener b/packaging/tests/tas-cmis/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/packaging/tests/tas-cmis/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index 6e93e33c34..be0e83e36f 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -36,6 +36,11 @@ jakarta.mail-api test + + com.epam.reportportal + agent-java-testng + test + diff --git a/packaging/tests/tas-email/src/test/resources/META-INF/services/org.testng.ITestNGListener b/packaging/tests/tas-email/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/packaging/tests/tas-email/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index 39f22cbf55..a7ff772ad1 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -44,6 +44,18 @@ test + + com.epam.reportportal + agent-java-testng + test + + + + com.squareup.okhttp3 + okhttp + test + + com.sun.mail jakarta.mail diff --git a/packaging/tests/tas-integration/src/test/resources/META-INF/services/org.testng.ITestNGListener b/packaging/tests/tas-integration/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/packaging/tests/tas-integration/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 6b627b9d7c..cc5f3ea354 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -79,6 +79,18 @@ ${commons-lang3.version} + + com.epam.reportportal + agent-java-testng + test + + + + com.squareup.okhttp3 + okhttp + test + + org.awaitility awaitility diff --git a/packaging/tests/tas-restapi/src/test/resources/META-INF/services/org.testng.ITestNGListener b/packaging/tests/tas-restapi/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/packaging/tests/tas-restapi/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 99d0652448..86fcce0c40 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -31,6 +31,11 @@ webdav test + + com.epam.reportportal + agent-java-testng + test + diff --git a/packaging/tests/tas-webdav/src/test/resources/META-INF/services/org.testng.ITestNGListener b/packaging/tests/tas-webdav/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/packaging/tests/tas-webdav/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/pom.xml b/pom.xml index c90af98721..0d41dd411d 100644 --- a/pom.xml +++ b/pom.xml @@ -819,6 +819,18 @@ 4.13.2 test + + com.epam.reportportal + agent-java-testng + 5.4.0 + test + + + com.squareup.okhttp3 + okhttp + 4.12.0 + test + org.antlr gunit diff --git a/remote-api/pom.xml b/remote-api/pom.xml index d85988ee49..7489844839 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -66,6 +66,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.mockito mockito-core diff --git a/remote-api/src/test/resources/META-INF/services/org.testng.ITestNGListener b/remote-api/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/remote-api/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/repository/pom.xml b/repository/pom.xml index 999861e894..b4a9ad522c 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -627,6 +627,11 @@ junit test + + com.epam.reportportal + agent-java-testng + test + org.assertj assertj-core diff --git a/repository/src/test/java/org/alfresco/messaging/camel/MessagingUnitTestSuite.java b/repository/src/test/java/org/alfresco/messaging/camel/MessagingUnitTestSuite.java new file mode 100644 index 0000000000..51d48d2ec1 --- /dev/null +++ b/repository/src/test/java/org/alfresco/messaging/camel/MessagingUnitTestSuite.java @@ -0,0 +1,38 @@ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2024 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco; + +import org.junit.experimental.categories.Categories; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Categories.class) +@Suite.SuiteClasses({ + org.alfresco.messaging.camel.CamelComponentsTest.class, + org.alfresco.messaging.camel.CamelRoutesTest.class +}) +public class MessagingUnitTestSuite { +} diff --git a/repository/src/test/resources/META-INF/services/org.testng.ITestNGListener b/repository/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000000..f335f0c13f --- /dev/null +++ b/repository/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +com.epam.reportportal.testng.ReportPortalTestNGListener diff --git a/scripts/ci/add_step_summary.sh b/scripts/ci/add_step_summary.sh new file mode 100644 index 0000000000..99b2416c55 --- /dev/null +++ b/scripts/ci/add_step_summary.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +echo "=========================== Starting Add Step Summary Script ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex + +echo "#### ⏱ Before Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY +echo "#### ⚙ Configuration" >> $GITHUB_STEP_SUMMARY + +if [[ "$RP_ENABLED" == 'true' ]]; then + echo "- [Report Portal]($RP_URL) configured with key "'`'$RP_KEY'`' >> $GITHUB_STEP_SUMMARY +else + echo "- Report Portal not enabled" >> $GITHUB_STEP_SUMMARY +fi + +set +vex +echo "=========================== Finishing Add Step Summary Script =========================="