netobserv / flowlogs-pipeline

Transform flow logs into metrics
Apache License 2.0
77 stars 24 forks source link

Adding k8s unit tests and some refactoring #578

Closed jotak closed 9 months ago

jotak commented 9 months ago

Description

No user-facing change / no API change

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

openshift-ci[bot] commented 9 months ago

[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 ask for approval from jotak. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/netobserv/flowlogs-pipeline/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codecov[bot] commented 9 months ago

Codecov Report

Attention: 83 lines in your changes are missing coverage. Please review.

Comparison is base (40b6948) 65.80% compared to head (2d0f97f) 66.13%. Report is 1 commits behind head on main.

Files Patch % Lines
pkg/pipeline/transform/kubernetes/enrich.go 52.50% 53 Missing and 4 partials :warning:
...peline/transform/kubernetes/informers/informers.go 16.00% 21 Missing :warning:
...e/transform/kubernetes/informers/informers-mock.go 88.00% 3 Missing :warning:
pkg/pipeline/transform/transform_network.go 33.33% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #578 +/- ## ========================================== + Coverage 65.80% 66.13% +0.33% ========================================== Files 102 103 +1 Lines 7445 7510 +65 ========================================== + Hits 4899 4967 +68 + Misses 2256 2252 -4 - Partials 290 291 +1 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/578/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/578/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `66.13% <52.02%> (+0.33%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jotak commented 9 months ago

I would have left the k8s function in the transform_network file, kubernetes package being more about informers but having them there also works.

well, kubernetes is named kubernetes so ... :-) perhaps we should name another sub-package informers then But I find it better to have some of the variables in kubernetes being unexported / better isolated.

OlivierCazade commented 9 months ago

Then why not moving the whole rule? This rule is only for kubernetes.

openshift-ci[bot] commented 9 months ago

New changes are detected. LGTM label has been removed.

jotak commented 9 months ago

/approve