From b94f8c72c13c0e19482261d22e1b8200071d4576 Mon Sep 17 00:00:00 2001 From: Florin Barbu Date: Fri, 3 Jan 2025 12:41:11 +0200 Subject: [PATCH] test_: add allure reporting --- .github/workflows/test-reliability.yml | 51 +++++++++++++++++++++++++- tests-functional/pytest.ini | 1 + tests-functional/requirements.txt | 4 +- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-reliability.yml b/.github/workflows/test-reliability.yml index 24111034da8..84b9e394714 100644 --- a/.github/workflows/test-reliability.yml +++ b/.github/workflows/test-reliability.yml @@ -15,6 +15,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get workflow status + uses: technote-space/workflow-conclusion-action@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -34,4 +37,50 @@ jobs: run: cd tests-functional; docker compose -f docker-compose.anvil.yml -f docker-compose.test.status-go.yml -f docker-compose.status-go.local.yml up --build --remove-orphans -d - name: Run tests - run: pytest -m "reliability" -c tests-functional/pytest.ini \ No newline at end of file + run: pytest -m "reliability" -c tests-functional/pytest.ini --alluredir=allure-results + + - name: Get allure history + if: env.WORKFLOW_CONCLUSION != 'cancelled' + uses: actions/checkout@v4 + continue-on-error: true + with: + repository: status-im/status-cli-tests + ref: gh-pages + path: gh-pages + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup allure report + uses: simple-elf/allure-report-action@master + if: env.WORKFLOW_CONCLUSION != 'cancelled' + id: allure-report + with: + allure_results: allure-results + gh_pages: gh-pages + allure_history: allure-history + keep_reports: 30 + report_url: `https://status-im.github.io/status-cli-tests/` + + - name: Deploy report to Github Pages + uses: peaceiris/actions-gh-pages@v4 + if: env.WORKFLOW_CONCLUSION != 'cancelled' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + external_repository: status-im/status-cli-tests + publish_branch: gh-pages + publish_dir: allure-history + + - name: Create job summary + if: always() + env: + JOB_STATUS: ${{ job.status }} + run: | + echo "## Run Information" >> $GITHUB_STEP_SUMMARY + echo "- **Event**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY + echo "- **Actor**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY + echo "## Test Results" >> $GITHUB_STEP_SUMMARY + echo "Allure report will be available at: https://status-im.github.io/status-cli-tests/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY + { + echo 'JOB_SUMMARY<> $GITHUB_ENV diff --git a/tests-functional/pytest.ini b/tests-functional/pytest.ini index c2a4e479b1d..5dd8ca89612 100644 --- a/tests-functional/pytest.ini +++ b/tests-functional/pytest.ini @@ -14,3 +14,4 @@ markers = init transaction create_account + reliability diff --git a/tests-functional/requirements.txt b/tests-functional/requirements.txt index 64e10d02f14..e728bf87840 100644 --- a/tests-functional/requirements.txt +++ b/tests-functional/requirements.txt @@ -9,4 +9,6 @@ pytest-dependency~=0.6.0 docker==7.1.0 pyright==1.1.388 black==24.10.0 -pre-commit==3.6.2 \ No newline at end of file +pre-commit==3.6.2 +allure-pytest==2.13.5 +allure-python-commons==2.13.5 \ No newline at end of file