Skip to content

Conversation

@katushiik11
Copy link
Contributor

This PR implements tests to improve test coverage in directories insights, sca & utils/anonymize.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • pkg/insights/insightsreport/insightsreport_test.go
  • pkg/insights/metrics_test.go
  • pkg/ocm/sca/architectures_gather_test.go
  • pkg/ocm/sca/sca_test.go
  • pkg/utils/anonymize/string_test.go
  • pkg/utils/anonymize/unstructured_test.go
  • pkg/utils/anonymize/url_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

No

Breaking Changes

No

References

https://issues.redhat.com/browse/CCXDEV-15561

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 21, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 21, 2026

@katushiik11: This pull request references CCXDEV-15561 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This PR implements tests to improve test coverage in directories insights, sca & utils/anonymize.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • pkg/insights/insightsreport/insightsreport_test.go
  • pkg/insights/metrics_test.go
  • pkg/ocm/sca/architectures_gather_test.go
  • pkg/ocm/sca/sca_test.go
  • pkg/utils/anonymize/string_test.go
  • pkg/utils/anonymize/unstructured_test.go
  • pkg/utils/anonymize/url_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

No

Breaking Changes

No

References

https://issues.redhat.com/browse/CCXDEV-15561

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from BaiyangZhou and ncaak January 21, 2026 10:32
@openshift-ci
Copy link

openshift-ci bot commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: katushiik11

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2026
@openshift-ci
Copy link

openshift-ci bot commented Jan 21, 2026

@katushiik11: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

expected: "Critical",
},
{
name: "invalid risk level 0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO one invalid test case should be enough

expected: "",
},
{
name: "single character",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the first two test cases should be enough to test this function

expected: []byte(""),
},
{
name: "single byte",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, keep only the first 2 test cases

expected string
}{
{
name: "basic URL",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these test cases could be probably drop as well

expected []string
}{
{
name: "multiple URLs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

expected string
}{
{
name: "multiple URLs separated by commas",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants