diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 9f2690a33ae..b8cbd556acd 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -5,6 +5,7 @@ adminer afinet androidx appspot +Arbritrary asyncio asyncpg auditability @@ -35,6 +36,7 @@ dotenvy dotglob drep dreps +earthfile encryptor fetchval fmtchk @@ -42,6 +44,7 @@ fmtfix fontawesome formz Formz +fuzzer gapless gcloud genhtml @@ -52,6 +55,7 @@ ideascale idents integ Intellij +iohk iphoneos jetbrains JoaquĆ­n @@ -65,6 +69,8 @@ lintfix localizable loguru mdlint +mgrybyk +mithril mitigations moderations multidex @@ -73,7 +79,6 @@ nanos netifas netkey nextest -nextest Oleksandr oneshot openapi @@ -118,13 +123,16 @@ testcov testdocs testunit thiserror +thollander timelike Traceback TXNZD unmanaged +UTXO vitss voteplan voteplans +wallclock xcconfig xcfilelist xcodebuild @@ -133,23 +141,3 @@ xctest xctestrun xcworkspace yoroi -idents -rustflags -rustdoc -rustdocflags -codegen -lintfix -testunit -nextest -testcov -testdocs -fmtchk -fmtfix -gethostname -afinet -netifas -UTXO -mithril -Arbritrary -iohk -wallclock \ No newline at end of file diff --git a/.github/workflows/generate-allure-report.yml b/.github/workflows/generate-allure-report.yml new file mode 100644 index 00000000000..e7b27b6e89d --- /dev/null +++ b/.github/workflows/generate-allure-report.yml @@ -0,0 +1,115 @@ +name: Allure Report Generation + +on: + pull_request: + push: + branches: 'main' + +permissions: + contents: write + pull-requests: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +env: + AWS_REGION: eu-central-1 + AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci + EARTHLY_TARGET: docker + ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com + ALLURE_REPORT_PATH: allure-report + REPORT_EXT: .junit-report.xml + +jobs: + generate-test-reports: + name: Generate test reports + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup CI + uses: input-output-hk/catalyst-ci/actions/setup@master + with: + aws_role_arn: ${{ env.AWS_ROLE_ARN }} + aws_region: ${{ env.AWS_REGION }} + earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }} + + - name: Get unit test report + uses: input-output-hk/catalyst-ci/actions/run@master + if: always() + continue-on-error: true + with: + earthfile: ./catalyst-gateway/ + flags: + targets: build + target_flags: + runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }} + artifact: "false" + + - name: Get schemathesis test report + uses: input-output-hk/catalyst-ci/actions/run@master + if: always() + continue-on-error: true + with: + earthfile: ./catalyst-gateway/tests/ + flags: --allow-privileged + targets: test-fuzzer-api + target_flags: + runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }} + artifact: "false" + + - name: Collect and upload test reports + uses: actions/upload-artifact@v4 + if: always() + with: + path: '**/*${{ env.REPORT_EXT }}' + if-no-files-found: error + retention-days: 1 + + generate-allure-report: + name: Generate allure report + runs-on: ubuntu-latest + needs: [generate-test-reports] + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v4 + + - name: Setup Allure report + run: | + mkdir -p ${{ env.ALLURE_REPORT_PATH }} + shopt -s globstar + cp **/*${{ env.REPORT_EXT }} ${{ env.ALLURE_REPORT_PATH }} + ls ${{ env.ALLURE_REPORT_PATH }} + + - name: Checkout gh-pages + uses: actions/checkout@v3 + with: + ref: gh-pages + path: gh-pages-dir + + - name: Build Allure report + uses: mgrybyk/allure-report-branch-action@v1 + id: allure + with: + report_id: 'test-report' + gh_pages: 'gh-pages-dir' + report_dir: ${{ env.ALLURE_REPORT_PATH }} + + - name: Git push to gh-pages + uses: mgrybyk/git-commit-pull-push-action@v1 + with: + repository: gh-pages-dir + branch: gh-pages + pull_args: --rebase -X ours + + - name: Comment PR with Allure report link + if: ${{ always() && github.event_name == 'pull_request' && steps.allure.outputs.report_url }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + ${{ steps.allure.outputs.test_result_icon }} [Test Report](${{ steps.allure.outputs.report_url }}) | ${\color{lightgreen}Pass: ${{ steps.allure.outputs.test_result_passed }}/${{ steps.allure.outputs.test_result_total }}}$ | ${\color{red}Fail: ${{ steps.allure.outputs.test_result_failed }}/${{ steps.allure.outputs.test_result_total }}}$ | + comment_tag: allure_report + mode: upsert \ No newline at end of file diff --git a/catalyst-gateway/Cargo.lock b/catalyst-gateway/Cargo.lock index a1c33218830..72d9ce90aa3 100644 --- a/catalyst-gateway/Cargo.lock +++ b/catalyst-gateway/Cargo.lock @@ -1449,9 +1449,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -3280,6 +3280,12 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" version = "0.2.91" @@ -3368,11 +3374,12 @@ dependencies = [ [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "0fec781d48b41f8163426ed18e8fc2864c12937df9ce54c88ede7bd47270893e" dependencies = [ - "wasm-bindgen", + "redox_syscall", + "wasite", "web-sys", ] diff --git a/catalyst-gateway/tests/Earthfile b/catalyst-gateway/tests/Earthfile index a4640b478ce..65a9dd0610f 100644 --- a/catalyst-gateway/tests/Earthfile +++ b/catalyst-gateway/tests/Earthfile @@ -38,7 +38,7 @@ test-fuzzer-api: docker cp st:/results/junit-report.xml junit-report.xml END WAIT - SAVE ARTIFACT junit-report.xml AS LOCAL junit-report.xml + SAVE ARTIFACT junit-report.xml AS LOCAL schemathesis.junit-report.xml SAVE ARTIFACT cat-gateway.log AS LOCAL cat-gateway.log END IF [ -f fail ] diff --git a/docs/src/index.md b/docs/src/index.md index d6e791c23d0..52017f8ad64 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -8,3 +8,7 @@ icon: material/chat * [MkDocs](https://www.mkdocs.org) * [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) + +## Test reports + +* [Main test report](https://input-output-hk.github.io/catalyst-voices/allure-action/main/test-report/latest.html)