chore(ci): enhance Python E2E and SonarCloud workflows with unit and and integration tests#26481
Conversation
…integration tests
There was a problem hiding this comment.
Pull request overview
This PR refactors the GitHub Actions Python testing workflows to improve SonarCloud coverage reporting and increase parallelism by splitting unit vs. integration execution (including sharded integration runs), then aggregating coverage before uploading to SonarCloud.
Changes:
- Split the nightly SonarCloud ingestion workflow into separate unit + sharded integration jobs, plus a coverage-combine job.
- Updated the CLI E2E workflow matrix to replace the single
pythonentry withpython-unittestsandpython-integration, and adjusted artifact uploads/conditions accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Splits unit/integration testing, shards integration tests, and adds a job to combine coverage before SonarCloud scan. |
| .github/workflows/py-cli-e2e-tests.yml | Updates the E2E matrix to separate Python unit vs. integration execution and changes coverage artifact handling. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates GitHub Actions workflows to improve Python CI signal for ingestion by splitting unit vs. integration test execution, adding integration test sharding for parallelism, and aggregating coverage before publishing to SonarCloud.
Changes:
- Split SonarCloud nightly ingestion workflow into separate unit + sharded integration jobs, with a dedicated coverage-combine job.
- Switch Python test execution to
noxsessions for unit/integration runs. - Update the CLI E2E workflow matrix to run Python unit tests and Python integration tests as separate entries and upload their coverage artifacts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Splits unit/integration testing, shards integration tests, downloads artifacts, combines coverage via nox, then runs Sonar scan. |
| .github/workflows/py-cli-e2e-tests.yml | Replaces python entry with python-unittests + python-integration, runs corresponding nox sessions, and uploads coverage artifacts. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates GitHub Actions workflows to run Python unit and integration tests via nox, shard integration tests for parallelism, and aggregate coverage artifacts before publishing results to SonarCloud.
Changes:
- Split the nightly Sonar workflow into dedicated unit-test, sharded integration-test, and coverage-combine/Sonar upload jobs.
- Updated the CLI E2E workflow matrix to run
python-unittestsandpython-integrationas distinct entries usingnox. - Adjusted coverage artifact handling (including hidden
.coverage*files) to support downstream aggregation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Introduces separate unit/integration jobs, shards integration tests, and adds a combine-coverage job before Sonar scan. |
| .github/workflows/py-cli-e2e-tests.yml | Splits the prior “python” entry into python-unittests + python-integration and updates coverage artifact naming/conditions. |
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| - name: Run Python Tests & record coverage | ||
| if: matrix.e2e-test == 'python' | ||
| id: python-e2e-test | ||
| - name: Run Python Integration Tests | ||
| if: matrix.e2e-test == 'python-integration' | ||
| id: python-integration-test | ||
| continue-on-error: true | ||
| run: | | ||
| source env/bin/activate | ||
| make coverage | ||
| cd ingestion | ||
| nox --no-venv -s integration-tests -- --standalone --durations=5 | ||
| env: |
| - name: Run Python Unit Tests | ||
| if: matrix.e2e-test == 'python-unittests' | ||
| id: python-unittest | ||
| continue-on-error: true | ||
| run: | | ||
| source env/bin/activate | ||
| cd ingestion | ||
| nox --no-venv -s unit-tests |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates GitHub Actions workflows to improve Python test execution and SonarCloud coverage reporting by splitting unit vs. integration testing, adding integration test sharding, and combining coverage artifacts before publishing results.
Changes:
- Split Python SonarCloud nightly workflow into dedicated unit/integration jobs and added a coverage-combine job.
- Sharded integration tests into two matrix shards for parallel execution.
- Updated CLI E2E workflow matrix defaults to run Python unit tests and Python integration tests as separate entries and upload their coverage artifacts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Adds unit + sharded integration jobs and a combine-coverage job before SonarCloud scan |
| .github/workflows/py-cli-e2e-tests.yml | Replaces prior single “python” entry with separate python unit/integration entries and updates coverage artifact handling |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the GitHub Actions Python test pipelines to improve parallelism and coverage reporting by splitting unit vs. integration tests, sharding integration runs, and aggregating coverage artifacts for SonarCloud analysis.
Changes:
- Split SonarCloud nightly ingestion workflow into separate unit and sharded integration jobs, plus a downstream coverage-combine + scan job.
- Update CLI E2E workflow to run Python unit tests and Python integration tests as distinct matrix entries and upload their coverage artifacts separately.
- Standardize Python test execution on
noxsessions for unit/integration runs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Splits unit/integration tests, shards integration suite, and adds a combine+Sonar scan job (currently missing required Sonar inputs). |
| .github/workflows/py-cli-e2e-tests.yml | Replaces the single “python” entry with separate “python-unittests” and “python-integration” matrix runs and uploads coverage artifacts accordingly. |
| name: coverage-unit | ||
| path: ingestion/.coverage | ||
| include-hidden-files: true | ||
|
|
There was a problem hiding this comment.
The unit test job produces JUnit XML (via the nox session) but only uploads the coverage file. Since the Sonar scan runs in a separate job, the JUnit report(s) need to be uploaded as an artifact here (e.g., ingestion/junit/test-results-.xml) and later downloaded in the combine/scan job, otherwise Sonar will not find any xUnit reports (sonar.python.xunit.reportPath=junit/test-results-.xml).
| - name: Upload JUnit test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-unit | |
| path: ingestion/junit/test-results-*.xml |
| name: coverage-integration-${{ matrix.shard.name }} | ||
| path: ingestion/.coverage | ||
| include-hidden-files: true | ||
|
|
There was a problem hiding this comment.
Same as unit tests: the integration nox session generates JUnit XML under ingestion/junit, but this job only uploads the coverage file. To keep Sonar test reporting intact when scanning in a downstream job, upload the JUnit XML as an artifact from here as well.
| - name: Upload JUnit XML artifact | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-integration-${{ matrix.shard.name }} | |
| path: ingestion/junit |
| source env/bin/activate | ||
| cd ingestion | ||
| coverage combine | ||
| coverage xml -i |
There was a problem hiding this comment.
This combine step generates coverage.xml (default output), but ingestion/sonar-project.properties is configured to read coverage from ci-coverage.xml (sonar.python.coverage.reportPaths=ci-coverage.xml). As written, the Sonar scan job will miss coverage. Update this step to produce ci-coverage.xml (and apply the same path-rewrite as the existing Makefile/nox session), e.g., run the existing nox session "combine-coverage" or replicate its sed + rename logic.
| source env/bin/activate | |
| cd ingestion | |
| coverage combine | |
| coverage xml -i | |
| cd ingestion | |
| source ../env/bin/activate | |
| nox -s combine-coverage | |
| with: | ||
| pattern: coverage-* | ||
| path: ingestion/coverage-data/ | ||
|
|
There was a problem hiding this comment.
The combine/scan job only downloads coverage artifacts (pattern: coverage-). If unit/integration jobs upload JUnit XML artifacts for Sonar, this job also needs to download them and place them under ingestion/junit/ before running the Sonar scan; otherwise sonar.python.xunit.reportPath=junit/test-results-.xml won't resolve.
| - name: Download JUnit artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: junit-* | |
| path: ingestion/junit/ |
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsEnhances Python E2E and SonarCloud workflows with comprehensive unit and integration test coverage, addressing the missing Slack failure notification for python test jobs. Consider preventing 💡 Edge Case: py-combine-coverage runs even if all test jobs fail/are cancelled📄 .github/workflows/py-sonarcloud-nightly.yml:146 📄 .github/workflows/py-sonarcloud-nightly.yml:174 The Consider adding a condition that checks at least one upstream job succeeded, or add Suggested fix✅ 1 resolved✅ Bug: Slack failure notification missing for python test jobs
🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
…and integration tests (#26481) * chore(ci): enhance Python E2E and SonarCloud workflows with unit and integration tests * seperate the unit and integration test * address commensts * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * address comments --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: ulixius9 <mayursingal9@gmail.com>
Describe your changes:
This pull request updates the Python test workflows in GitHub Actions to improve test coverage reporting, enable test sharding for integration tests, and streamline the execution and artifact handling for both unit and integration tests. The changes introduce separate jobs for unit and integration tests, shard integration tests for better parallelism, and add a new job to combine coverage data before pushing results to SonarCloud.
Test Workflow Improvements
py-unit-tests) and integration tests (py-integration-tests), with the integration tests now sharded into two groups for parallel execution.noxfor running both unit and integration tests, replacing previousmakecommands and ensuring consistent test environments. [1] [2]Coverage Collection and Aggregation
ingestion/.coveragepath and include hidden files. [1] [2]py-combine-coveragejob to download all coverage artifacts, prepare and rename them as needed, and then combine the results using a dedicatednoxsession before pushing to SonarCloud.These changes will result in more reliable and granular test reporting, improved parallelism for integration tests, and accurate combined coverage metrics for SonarCloud analysis.
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>