Skip to content

Unit tests for more coverage#340

Draft
afcollins wants to merge 11 commits intocloud-bulldozer:mainfrom
afcollins:unittests
Draft

Unit tests for more coverage#340
afcollins wants to merge 11 commits intocloud-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.

afcollins and others added 9 commits April 3, 2026 14:10
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…runs, agg types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers ReportType enum, produce_report dispatching, LOG/JSON/regressions_only
formats, changepoint annotations, column_group_size, and helper methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Andrew Collins <ancollin@redhat.com>
@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 and others added 2 commits April 3, 2026 16:40
Signed-off-by: Andrew Collins <ancollin@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Andrew Collins <ancollin@redhat.com>
@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

@ArthurChenCoding ArthurChenCoding self-requested a review April 7, 2026 21:19
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