Skip to content
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

NETOBSERV-2006 Cover all new features in e2e tests #148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Jan 15, 2025

Description

Add --yaml option to be able to test metrics command.
Also test flow & packet yaml output with filters

Dependencies

Based on #146, merge it first !

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.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Copy link

openshift-ci bot commented Jan 15, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

openshift-ci bot commented Jan 15, 2025

[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 jpinsonneau. For more information see the 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:

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

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.70%. Comparing base (51e6676) to head (b36ebd6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #148   +/-   ##
=======================================
  Coverage   23.70%   23.70%           
=======================================
  Files          11       11           
  Lines        1333     1333           
=======================================
  Hits          316      316           
  Misses       1000     1000           
  Partials       17       17           
Flag Coverage Δ
unittests 23.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@skrthomas skrthomas left a comment

Choose a reason for hiding this comment

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

One nit :)

@jpinsonneau jpinsonneau force-pushed the 2006 branch 2 times, most recently from 3039e68 to e6559ab Compare January 23, 2025 10:02
@jpinsonneau
Copy link
Contributor Author

Rebased without changes

@jpinsonneau
Copy link
Contributor Author

Rebased again without changes

@jpinsonneau
Copy link
Contributor Author

FYI e2e is failing because of netobserv/netobserv-ebpf-agent#513

@jpinsonneau
Copy link
Contributor Author

Rebased without changes

@jpinsonneau
Copy link
Contributor Author

jpinsonneau commented Mar 3, 2025

  • Had to refactor the PR to adapt the changes done in parallel
  • Also moved the cluster role & binding related to metrics in the service monitor yaml to avoid applying it for flows and packets
  • increased the pod collector waiting timeout as kind is a bit slow to pull image at first run

@jpinsonneau
Copy link
Contributor Author

/retest

@memodi
Copy link

memodi commented Mar 5, 2025

/ok-to-test

Copy link

github-actions bot commented Mar 5, 2025

New image:
quay.io/netobserv/network-observability-cli:f5bd1f9

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=f5bd1f9 make commands

or download the updated commands.

@memodi
Copy link

memodi commented Mar 5, 2025

/label qe-approved
thanks @jpinsonneau , yamls are generated as expected.

yamls = strings.Split(yamlStr, "---")
assert.Equal(t, 6, len(yamls))

// check yaml contents
Copy link
Contributor

Choose a reason for hiding this comment

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

this is hard to maintain why not create a multi line yaml content string and u can compare against it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could you please provide an example ?

Copy link
Contributor

Choose a reason for hiding this comment

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

here is an example of constant yaml string

yaml := `
kind: Namespace
apiVersion: v1
metadata:
  name: netobserv-cli
  labels:
    app: netobserv
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/audit: privileged
    openshift.io/cluster-monitoring: "true"
`

yamls = strings.Split(yamlStr, "---")
assert.Equal(t, 6, len(yamls))

// check yaml contents
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

yamls = strings.Split(yamlStr, "---")
assert.Equal(t, 10, len(yamls))

// check yaml contents
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

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.

5 participants