Skip to content
Success

Changes

Summary

  1. feat(tools): add reporter tool for flaky test analysis and reporting (commit: 5bd7e6d) (details)
Commit 5bd7e6d0af50fdafd0e6f477ec0faa7695beb741 by noreply
feat(tools): add reporter tool for flaky test analysis and reporting (#3750)

This pull request introduces three new core modules to the Flaky
Reporter tool: `ConfigLoader`, `Database`, and `FlakyReporter`. These
modules provide a clear separation of responsibilities for configuration
parsing, database interaction, and flaky test aggregation, making the
codebase easier to maintain and extend. Each module is well-documented
and designed for composability, with improved error handling and type
safety.

**Core module additions and responsibilities:**

* **Configuration management**
- Added `ConfigLoader` class for parsing CLI arguments and environment
variables, resolving time windows, database and SMTP configurations, and
loading owner maps from YAML/JSON files. This centralizes configuration
logic and improves error handling.

* **Database abstraction**
- Added `Database` class to manage MySQL connections, provide typed
accessors for querying `problem_case_runs` and owner-mapping tables, and
ensure safe connection lifecycle management. Includes methods for
fetching runs, querying owners, and quoting table names securely.

* **Flaky test aggregation**
- Added `FlakyReporter` class to aggregate test runs by case, suite, and
team, and to compute top flaky cases. Integrates with `OwnerResolver`
for ownership resolution and provides verbose logging for debugging.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
(commit: 5bd7e6d)
The file was addedtools/reporters/ci/flaky-tests/core/ConfigLoader.ts
The file was addedtools/reporters/ci/flaky-tests/main.ts
The file was addedtools/reporters/ci/flaky-tests/utils/EmailClient.ts
The file was addedtools/reporters/ci/flaky-tests/utils/db.ts
The file was addedtools/reporters/ci/flaky-tests/render/HtmlRenderer.ts
The file was addedtools/reporters/ci/flaky-tests/core/OwnerResolver.test.ts
The file was addedtools/reporters/ci/flaky-tests/core/FlakyReporter.ts
The file was addedtools/reporters/ci/flaky-tests/core/types.ts
The file was addedtools/reporters/ci/flaky-tests/core/OwnerResolver.ts
The file was addedtools/reporters/ci/flaky-tests/docs/README.md
The file was addedtools/reporters/ci/flaky-tests/docs/owner-map.example.yaml
The file was addedtools/reporters/ci/flaky-tests/core/Database.ts
The file was addedtools/reporters/ci/flaky-tests/deno.json
The file was modified.gitignore (diff)
The file was addedtools/reporters/ci/flaky-tests/deno.lock