From 10997f3b6144e31bdb07776ee95a5578064bed10 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 28 Mar 2025 13:36:02 -0400 Subject: [PATCH 1/4] health: publish test results to code cov --- .github/workflows/tests.yml | 65 +++++++++++++++---------------------- .gitignore | 1 + 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d60e9b6c..c6778cbcb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,60 +35,47 @@ jobs: pip install -r requirements/testing_without_asyncio.txt - name: Run tests without aiohttp run: | - pytest tests/slack_bolt/ - pytest tests/scenario_tests/ + pytest tests/slack_bolt/ --junitxml=reports/slack_bolt.xml + pytest tests/scenario_tests/ --junitxml=reports/scenario_tests.xml - name: Install adapter dependencies run: | pip install -r requirements/adapter.txt pip install -r requirements/adapter_testing.txt - - name: Run tests for HTTP Mode adapters (AWS) + - name: Run tests for HTTP Mode adapters run: | - pytest tests/adapter_tests/aws/ - - name: Run tests for HTTP Mode adapters (Bottle) - run: | - pytest tests/adapter_tests/bottle/ - - name: Run tests for HTTP Mode adapters (CherryPy) - run: | - pytest tests/adapter_tests/cherrypy/ - - name: Run tests for HTTP Mode adapters (Django) - run: | - pytest tests/adapter_tests/django/ - - name: Run tests for HTTP Mode adapters (Falcon) - run: | - pytest tests/adapter_tests/falcon/ - - name: Run tests for HTTP Mode adapters (Flask) - run: | - pytest tests/adapter_tests/flask/ - - name: Run tests for HTTP Mode adapters (Pyramid) - run: | - pytest tests/adapter_tests/pyramid/ - - name: Run tests for HTTP Mode adapters (Starlette) - run: | - pytest tests/adapter_tests/starlette/ - - name: Run tests for HTTP Mode adapters (Tornado) - run: | - pytest tests/adapter_tests/tornado/ - - name: Run tests for HTTP Mode adapters (WSGI) - run: | - pytest tests/adapter_tests/wsgi/ + pytest tests/adapter_tests/ \ + --ignore=tests/adapter_tests/socket_mode/ \ + --ignore=tests/adapter_tests/asgi/ \ + --junitxml=reports/adapter_tests.xml - name: Install async dependencies run: | pip install -r requirements/async.txt + - name: Run tests for HTTP Mode adapters (ASGI) + run: | + # Requires async test dependencies + pytest tests/adapter_tests/asgi/ --junitxml=reports/adapter_tests_asgi.xml - name: Run tests for Socket Mode adapters run: | # Requires async test dependencies - pytest tests/adapter_tests/socket_mode/ + pytest tests/adapter_tests/socket_mode/ --junitxml=reports/adapter_tests_socket_mode.xml - name: Run tests for HTTP Mode adapters (asyncio-based libraries) run: | - pytest tests/adapter_tests_async/ - - name: Run tests for HTTP Mode adapters (ASGI) - run: | - # Requires async test dependencies - pytest tests/adapter_tests/asgi/ + pytest tests/adapter_tests_async/ --junitxml=reports/adapter_tests_async.xml - name: Install all dependencies run: | pip install -r requirements/testing.txt - name: Run asynchronous tests run: | - pytest tests/slack_bolt_async/ - pytest tests/scenario_tests_async/ + pytest tests/slack_bolt_async/ --junitxml=reports/slack_bolt_async.xml + pytest tests/scenario_tests_async/ --junitxml=reports/scenario_tests_async.xml + - name: Merge junit xml testsuite results + run: | + python scripts/merge_junit_results.py reports/*.xml >&0 | cat > report.xml + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + directory: ./reports/ + flags: ${{ matrix.python-version }} + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.gitignore b/.gitignore index f36c24c5a..2549060e7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ venv/ .coverage cov_* coverage.xml +reports/ # due to using tox and pytest .tox From af3f83e007033bbdbcc818d618d97dbc2c448f94 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 28 Mar 2025 13:50:21 -0400 Subject: [PATCH 2/4] Update config to upload all tests --- .github/workflows/tests.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c6778cbcb..ea3a20f36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,8 +35,8 @@ jobs: pip install -r requirements/testing_without_asyncio.txt - name: Run tests without aiohttp run: | - pytest tests/slack_bolt/ --junitxml=reports/slack_bolt.xml - pytest tests/scenario_tests/ --junitxml=reports/scenario_tests.xml + pytest tests/slack_bolt/ --junitxml=reports/test_slack_bolt.xml + pytest tests/scenario_tests/ --junitxml=reports/test_scenario.xml - name: Install adapter dependencies run: | pip install -r requirements/adapter.txt @@ -46,36 +46,34 @@ jobs: pytest tests/adapter_tests/ \ --ignore=tests/adapter_tests/socket_mode/ \ --ignore=tests/adapter_tests/asgi/ \ - --junitxml=reports/adapter_tests.xml + --junitxml=reports/test_adapter.xml - name: Install async dependencies run: | pip install -r requirements/async.txt - name: Run tests for HTTP Mode adapters (ASGI) run: | # Requires async test dependencies - pytest tests/adapter_tests/asgi/ --junitxml=reports/adapter_tests_asgi.xml + pytest tests/adapter_tests/asgi/ --junitxml=reports/test_adapter_asgi.xml - name: Run tests for Socket Mode adapters run: | # Requires async test dependencies - pytest tests/adapter_tests/socket_mode/ --junitxml=reports/adapter_tests_socket_mode.xml + pytest tests/adapter_tests/socket_mode/ --junitxml=reports/test_adapter_socket_mode.xml - name: Run tests for HTTP Mode adapters (asyncio-based libraries) run: | - pytest tests/adapter_tests_async/ --junitxml=reports/adapter_tests_async.xml + pytest tests/adapter_tests_async/ --junitxml=reports/test_adapter_async.xml - name: Install all dependencies run: | pip install -r requirements/testing.txt - name: Run asynchronous tests run: | - pytest tests/slack_bolt_async/ --junitxml=reports/slack_bolt_async.xml - pytest tests/scenario_tests_async/ --junitxml=reports/scenario_tests_async.xml - - name: Merge junit xml testsuite results - run: | - python scripts/merge_junit_results.py reports/*.xml >&0 | cat > report.xml + pytest tests/slack_bolt_async/ --junitxml=reports/test_slack_bolt_async.xml + pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: directory: ./reports/ + files: test*.xml flags: ${{ matrix.python-version }} token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 2e8cc9ced7d168c9c6c2d1e186bbea1baa65b755 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 28 Mar 2025 15:37:18 -0400 Subject: [PATCH 3/4] Try to only use the files property --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea3a20f36..a2212c962 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,8 +72,7 @@ jobs: if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: - directory: ./reports/ - files: test*.xml + files: ./reports/test_*.xml flags: ${{ matrix.python-version }} token: ${{ secrets.CODECOV_TOKEN }} verbose: true From ab1873378ba9c603507a6b7f36de73fd28a188ca Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 28 Mar 2025 15:41:55 -0400 Subject: [PATCH 4/4] just use the directory --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2212c962..b4f1743da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,7 +72,7 @@ jobs: if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: - files: ./reports/test_*.xml + directory: ./reports/ flags: ${{ matrix.python-version }} token: ${{ secrets.CODECOV_TOKEN }} verbose: true