Skip to content

Commit

Permalink
ACS-6309 Integration with report portal initial commit [tas]
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekswieton committed Sep 25, 2024
1 parent a1e00f7 commit e182e56
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
48 changes: 47 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ env:
ALF_LICENCE_LOCAL_PATH: /tmp/licence.lic
PYTHON_VERSION: 3.7.15
DTAS_VERSION: v1.5.5
# Report Portal settings
RP_LAUNCH_PREFIX: "${{ github.workflow }} - ${{ github.job }}"
RP_PROJECT: alfresco-backend

jobs:
veracode_sca:
Expand Down Expand Up @@ -202,13 +205,56 @@ jobs:
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/${{ matrix.compose-file }}
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
- name: "Prepare Report Portal"
if: github.ref_name == 'feature/ACS-6309_Bump_TestNG'
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v7.0.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
continue-on-error: true
- name: "Add GitHub Step Summary"
if: github.ref_name == 'feature/ACS-6309_Bump_TestNG'
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
continue-on-error: true
- name: "Run tests"
id: tests
timeout-minutes: ${{ matrix.deploy-timeout }}
run: mvn -B install -ntp -f ${{ matrix.pom-dir }}/pom.xml -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false
env:
RP_OPTS: ${{ github.ref_name == 'feature/ACS-6309_Bump_TestNG' && steps.rp-prepare.outputs.mvn-opts || '' }}
run: |
eval "args=($RP_OPTS)"
mvn -B install -ntp -f ${{ matrix.pom-dir }}/pom.xml -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false "${args[@]}"
continue-on-error: true
- name: "Update GitHub Step Summary"
if: github.ref_name == 'feature/ACS-6309_Bump_TestNG'
run: |
echo "#### ⏱ After Tests: $(date -u +'%Y-%m-%d %H:%M:%S%:z')" >> $GITHUB_STEP_SUMMARY
continue-on-error: true
- name: "Summarize Report Portal"
if: github.ref_name == 'feature/ACS-6309_Bump_TestNG'
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v7.0.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 }}
continue-on-error: true
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "${{ matrix.pom-dir }}"
- name: "Exit on failure"
if: steps.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 =========================="
1 change: 1 addition & 0 deletions tests/tas-restapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<dependency>
<groupId>com.epam.reportportal</groupId>
<artifactId>agent-java-testng</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.epam.reportportal.testng.ReportPortalTestNGListener

0 comments on commit e182e56

Please sign in to comment.