Skip to content

Commit

Permalink
ACS-6309 Integration with Report Portal - changes in CI for remote_ap…
Browse files Browse the repository at this point in the history
…i_app_context_test_suites
  • Loading branch information
wojtekswieton committed Jan 30, 2024
1 parent 60e42b4 commit bd98f88
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
41 changes: 40 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env:
CI_WORKSPACE: ${{ github.workspace }}
TAS_ENVIRONMENT: ./packaging/tests/environment
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
# Report Portal settings
RP_LAUNCH_PREFIX: "${{ github.workflow }} - ${{ github.job }}"
RP_PROJECT: alfresco-backend

jobs:
prepare:
Expand Down Expand Up @@ -196,8 +199,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/[email protected]
id: rp-prepare
with:
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.tests.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"
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/[email protected]
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

Expand Down
17 changes: 17 additions & 0 deletions scripts/ci/add_step_summary.sh
Original file line number Diff line number Diff line change
@@ -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 =========================="

0 comments on commit bd98f88

Please sign in to comment.