Python: Add flaky test trend reporting to CI workflows - #5339
Closed
Giles Odigwe (giles17) wants to merge 9 commits into
Closed
Python: Add flaky test trend reporting to CI workflows#5339Giles Odigwe (giles17) wants to merge 9 commits into
Giles Odigwe (giles17) wants to merge 9 commits into
Conversation
Parse JUnit XML (pytest.xml) from each integration test job and aggregate results into a markdown trend report showing per-test pass/fail/skip status across the last 5 runs. Changes: - Add python/scripts/flaky_report/ package (JUnit XML parser + trend report generator following the sample_validation pattern) - Add upload-artifact steps to all 6 integration test jobs in both python-merge-tests.yml and python-integration-tests.yml - Add python-flaky-test-report aggregation job with history caching - Add --junitxml=pytest.xml to integration-tests.yml jobs (already present in merge-tests.yml) - Fix Cosmos job --junitxml path (use absolute path since uv run --directory changes cwd) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Guard against missing reports directory in load_current_run() - Only run report job when at least one integration test job completed (skip when all jobs are skipped, e.g. on pull_request events) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Python CI “flaky test trend” report, similar in spirit to the existing sample validation trend report, by collecting per-job JUnit XML artifacts, persisting short history via Actions cache, and publishing a markdown trend table to the job summary.
Changes:
- Introduces
python/scripts/flaky_report/to parse JUnit XML and generate a multi-run trend markdown report. - Updates Python CI workflows to emit
pytest.xmlartifacts from integration jobs and adds a final aggregation/reporting job. - Fixes Cosmos integration job JUnit output location by switching to an absolute
--junitxmlpath.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
python/scripts/flaky_report/aggregate.py |
New aggregator/parser and markdown trend report generator for JUnit XML. |
python/scripts/flaky_report/__main__.py |
Module entrypoint wiring python -m scripts.flaky_report to the aggregator. |
python/scripts/flaky_report/__init__.py |
Package docstring/usage for the flaky report tool. |
.github/workflows/python-merge-tests.yml |
Uploads per-job JUnit artifacts and adds a final “Flaky Test Report” aggregation job; fixes Cosmos junitxml path. |
.github/workflows/python-integration-tests.yml |
Adds missing --junitxml, uploads artifacts, and adds the final aggregation/reporting job. |
Giles Odigwe (giles17)
marked this pull request as draft
April 17, 2026 21:54
- Use explicit provider name mapping in _derive_provider() so OpenAI renders correctly instead of 'Openai' - Fix operator precedence in workflow if-expressions by wrapping success/failure checks in parentheses Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Giles Odigwe (giles17)
marked this pull request as ready for review
April 17, 2026 21:57
Giles Odigwe (giles17)
marked this pull request as draft
April 17, 2026 22:12
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 22:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 17, 2026 23:42 — with
GitHub Actions
Inactive
- Add File column showing module name (e.g., test_openai_chat_client) to disambiguate tests with the same function name across files - Detect pytest xfail tests in JUnit XML (type=pytest.xfail) and show them with a distinct warning emoji instead of skip emoji - Update legend to include xfail explanation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sync the Foundry integration job in python-merge-tests.yml with python-integration-tests.yml by adding FOUNDRY_MODELS_ENDPOINT, FOUNDRY_MODELS_API_KEY, FOUNDRY_EMBEDDING_MODEL, and FOUNDRY_IMAGE_EMBEDDING_MODEL. Once the repo variables/secrets are configured, the embedding integration test will run in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o flaky-test-report
When a test is inside a class, pytest writes the classname as e.g. 'pkg.test_file.TestClass'. The previous rsplit logic extracted 'TestClass' instead of 'test_file'. Now detect uppercase-starting segments as class names and use the preceding segment instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Giles Odigwe (giles17)
had a problem deploying
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Failure
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
Giles Odigwe (giles17)
temporarily deployed
to
integration
April 21, 2026 21:02 — with
GitHub Actions
Inactive
…ocstring - Use datetime.now(timezone.utc) for accurate UTC timestamps - Catch ET.ParseError per-file so corrupt XML doesn't crash the report - Remove separate 'error' key from summary (errors folded into 'failed') - Fix _short_name docstring to show actual dotted classname::name format Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a flaky test trend reporting system to CI, following the same pattern as sample validation reports.
What it does
Changes
Report covers
Only the 6 integration test jobs (OpenAI, Azure OpenAI, Misc, Functions, Foundry, Cosmos). Unit tests are excluded.
How to test
Trigger Integration Tests (Manual) workflow against this branch. The Flaky Test Report job summary will show the trend table.