Skip to content

Increase code coverage of SSABasedGenericKubernetesResourceMatcher #2781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Donnerbart
Copy link
Contributor

@Donnerbart Donnerbart commented May 2, 2025

Before: 91% methods, 86% lines covered
After: 100% methods, 99% lines covered

This should be the only missing line now:

if (log.isTraceEnabled()) {
  log.trace("Pruned actual resource:\n {} \ndesired resource:\n {} ", actualYaml, desiredYaml);
}

I hope you don't mind the re-ordering of the methods, but I find code always very hard to read if the methods are not sorted by their invocation order. The only changes to the production class are:

  • Reorder fields and methods.
  • Make getDiff(), sortMap() and sortListItems() static.
  • Reformat code comments.
  • Make keepOnlyManagedFields() package private (to make it directly testable).

@openshift-ci openshift-ci bot requested review from csviri and xstefank May 2, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant