Skip to content

Commit

Permalink
Fix report name
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Oct 8, 2024
1 parent bee72dc commit 81a9915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ jobs:
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo $(curl -s -H "Authorization: token ${{ github.token }}" "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" )
# Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API
JOB_ID=$(curl -s -H "Authorization: token ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | \
jq -r '.jobs[] | select(.name | startswith("${{ github.job }}")) | .id')
echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"
echo "test_report_path=reports/report_$JOB_ID.xml" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}
Expand Down Expand Up @@ -86,7 +88,7 @@ jobs:
shell: bash
run: |
source env/activate
pytest 2>&1 | tee pytest.log
pytest --junit-xml=${{ steps.strings.outputs.test_report_path }} 2>&1 | tee pytest.log
- name: Upload Test Log
uses: actions/upload-artifact@v4
Expand All @@ -98,11 +100,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.build.runs-on }}
path: reports/report_${{ steps.strings.outputs.job-id }}.xml
path: ${{ steps.strings.outputs.test_report_path }}

- name: Show Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: reports/report.xml
report_paths: ${{ steps.strings.outputs.test_report_path }}
check_name: TT-Forge-FE Tests
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[pytest]

# Ignore specific tests
addopts = -svv --junit-xml=reports/report.xml
addopts = -svv

# Where pytest should look for tests
testpaths =
Expand Down

0 comments on commit 81a9915

Please sign in to comment.