Skip to content

Unit tests for more coverage#340

Draft
afcollins wants to merge 4 commits into
cloud-bulldozer:mainfrom
afcollins:unittests
Draft

Unit tests for more coverage#340
afcollins wants to merge 4 commits into
cloud-bulldozer:mainfrom
afcollins:unittests

Conversation

@afcollins
Copy link
Copy Markdown
Member

Type of change

  • Bug fix

Description

Generated unit tests for 100% coverage to provide a foundation before any refactoring.

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please describe the System Under Test.
  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jtaleric for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@afcollins afcollins marked this pull request as draft April 6, 2026 16:41
@afcollins afcollins changed the title "legacy code" is untested code, but not anymore Unit tests for more coverage Apr 6, 2026
@ArthurChenCoding
Copy link
Copy Markdown
Member

thanks for opening this

afcollins added 4 commits May 12, 2026 17:21
Covers 109 new tests across utils (62) and config (47), bringing total
to 153. Includes behavior-guard tests for float timestamp handling and
YAML numeric coercion.

add unit tests for algorithm base class, EDivisive, IsolationForest, and CMR

41 new tests covering output formatting (json/text/junit), analysis
caching, series setup, direction/threshold/ack filtering, changepoint
grouping, anomaly detection, mean comparison, and the algorithm factory.

add unit tests for github_client.py

60 new tests covering timestamp coercion (13 input types), ISO parsing,
interval validation, request error handling (404/403/500/timeout/bad JSON),
URL building, release/commit processing, caching, change context assembly,
and PR creation date lookup.

add unit tests for run_test.py and matcher.py coverage gaps

29 new tests for run_test.py: get_algorithm_type, has_early_changepoint,
clear_early_changepoints, get_start_timestamp (incl. PR creation date),
tabulate_average_values, and NamedTuple structures.

20 new tests for matcher.py gaps: get_metadata_by_uuid actual logic,
get_uuid_by_metadata edge cases (buildUrl fallback, additional_fields,
dotted version field, not clause, ocpMajorVersion, pullNumber=0),
parse_agg_results without aggregations, convert_to_df/save_results
column filtering.

expand matcher.py test coverage for date ranges, get_results, filter_runs, agg types

add unit tests for visualization.py with direction behavior guard

Covers _short_version, _prepare_timestamps, _classify_changepoint,
VizData, _build_test_figure, and generate_test_html. Includes behavior
guard documenting that direction=1 means increase-is-regression, which
is opposite to the EDivisive convention.

add unit tests for reporting/report.py

Covers ReportType enum, produce_report dispatching, LOG/JSON/regressions_only
formats, changepoint annotations, column_group_size, and helper methods.

refactor pylint into make lint, exclude tests, add TODO_unittest.txt

Move pylint invocation from workflow inline command to Makefile lint
target. Exclude test files from lint (grep -v '/tests/') and document
remaining lint cleanup in TODO_unittest.txt. Partial lint fixes applied:
unused imports removed, unused variables prefixed, _make_algo renamed.

remove TODO file

Add pylint to makefile help

add query_index return_all unit tests

Updates to resolve warnings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Andrew Collins <ancollin@redhat.com>

Update tests for percentile iteration changes

Co-Authored-By: Claude Opus 4.6
Co-Authored-By: Claude Opus 4.6
Signed-off-by: Andrew Collins <ancollin@redhat.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 40bfdbe1-49e6-4d63-8025-e96bc21b9e95

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 17, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants