Skip to content

Conversation

oliver-smakal
Copy link
Contributor

Description

fixes table.spec.ts tests

Dependencies

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).

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 24, 2025

@oliver-smakal: This pull request references NETOBSERV-2252 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 story to target the "4.21.0" version, but no target version was set.

In response to this:

Description

fixes table.spec.ts tests

Dependencies

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).

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.

Copy link

openshift-ci bot commented Sep 24, 2025

Hi @oliver-smakal. Thanks for your PR.

I'm waiting for a netobserv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@oliver-smakal
Copy link
Contributor Author

/test?

Copy link

openshift-ci bot commented Sep 25, 2025

@oliver-smakal: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test?

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.

@oliver-smakal
Copy link
Contributor Author

/test all

Copy link

openshift-ci bot commented Sep 25, 2025

@oliver-smakal: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test all

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.

@oliver-smakal
Copy link
Contributor Author

/ok-to-test

Copy link

openshift-ci bot commented Sep 25, 2025

@oliver-smakal: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@oliver-smakal
Copy link
Contributor Author

/assign @oliver-smakal

@oliver-smakal
Copy link
Contributor Author

/lgtm

Copy link

openshift-ci bot commented Sep 25, 2025

@oliver-smakal: you cannot LGTM your own PR.

In response to this:

/lgtm

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.

changeMetricType(name: string): Chainable<Element>
checkRecordField(field: string, name: string, values: string[])
clickShowDuplicates()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the method signature definitions in here:

declare global {
  namespace Cypress {
    interface Chainable {

Seems to not be matching the signatures of the function declaratinons. For example:

Cypress.Commands.add('changeMetricType', (name) => {
 cy.showAdvancedOptions();
 cy.showDisplayOptions();
 cy.get('#metricType-dropdown').click();
 cy.get('.pf-v5-c-menu__content').contains(name).click();
 cy.get('[data-layer-id="default"]').children().its('length').should('be.gte', 5);
});

has not return, but the return type of Chainable<Element> is defined in the interface.

Am I missing something or is this wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that looks like bad copy pastes 😉

Copy link
Member

Choose a reason for hiding this comment

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

interesting, I guess our custom commands have that problem too :) , mostly from copy pasting the signatures :). We mostly use custom commands to abstract set of common of UI interactions.

thanks for spotting that.

@oliver-smakal
Copy link
Contributor Author

/cc @jpinsonneau

@openshift-ci openshift-ci bot requested a review from jpinsonneau September 25, 2025 12:24
@oliver-smakal
Copy link
Contributor Author

/cc @memodi

@openshift-ci openshift-ci bot requested a review from memodi September 25, 2025 12:25
@memodi
Copy link
Member

memodi commented Sep 25, 2025

/test plugin-cypress

Copy link
Member

@memodi memodi left a comment

Choose a reason for hiding this comment

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

I have triggered plugin-cypress to see the results in CI 🤞

changeMetricType(name: string): Chainable<Element>
checkRecordField(field: string, name: string, values: string[])
clickShowDuplicates()
}
Copy link
Member

Choose a reason for hiding this comment

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

interesting, I guess our custom commands have that problem too :) , mostly from copy pasting the signatures :). We mostly use custom commands to abstract set of common of UI interactions.

thanks for spotting that.

@memodi
Copy link
Member

memodi commented Sep 25, 2025

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. and removed needs-ok-to-test labels Sep 25, 2025
Copy link

New image:
quay.io/netobserv/network-observability-console-plugin:a263aec

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=a263aec make set-plugin-image

@oliver-smakal
Copy link
Contributor Author

@oliver-smakal looks like overview.spec.ts is also failing https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/netobserv_network-observability-console-plugin/1042/pull-ci-netobserv-network-observability-console-plugin-main-plugin-cypress/1971237294786482176/build-log.txt.

Well it seems to be flaky test. Originally I tried to do it without mock data and it seemed to work for a while, hence I was trying to see why it only does not work with mock data, but after some time I figured out that the test itself is flaky. I wrote a short script to run it locally 50 times and the following is the outcome:

Summary of 50 runs:
---------------------------
Total Runs: 50
Successful Runs: 9
Failed Runs: 41

Investigating further.

@openshift-ci openshift-ci bot removed the lgtm label Oct 4, 2025
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 4, 2025
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.10%. Comparing base (4b69722) to head (308b4b1).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
pkg/handler/lokiclientmock/loki_client_mock.go 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1042      +/-   ##
==========================================
- Coverage   55.99%   53.10%   -2.90%     
==========================================
  Files         165      205      +40     
  Lines        7633    11137    +3504     
  Branches     1294     1295       +1     
==========================================
+ Hits         4274     5914    +1640     
- Misses       3016     4711    +1695     
- Partials      343      512     +169     
Flag Coverage Δ
uitests 55.97% <ø> (-0.02%) ⬇️
unittests 46.82% <0.00%> (?)

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

Files with missing lines Coverage Δ
pkg/handler/lokiclientmock/loki_client_mock.go 0.00% <0.00%> (ø)

... and 42 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oliver-smakal
Copy link
Contributor Author

/test plugin-cypress

@oliver-smakal
Copy link
Contributor Author

@jpinsonneau @memodi , the 2nd failing test should be also fixed and therefore the pr is ready for further review.

As for the interface - reading though documentation, the output of any command will always be Chainable with whatever is being injected inside. It does not seem to be quite clear what is the internal type - if it is void/undefined or something else, but also does not seem to be quite that important - I sicked with void.

Copy link
Member

@memodi memodi left a comment

Choose a reason for hiding this comment

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

thanks @oliver-smakal , just couple of questions.

//Save
cy.setupNetworkIdleTracking('GET', '/api/flow/metrics*');
cy.get('#overview-panels-modal').contains('Save').click();

Copy link
Member

@memodi memodi Oct 7, 2025

Choose a reason for hiding this comment

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

I am curious, how this is different than simply intercepting for /api/flow/metrics request and waiting for call to happen, like we have here:

https://github.com/openshift/openshift-tests-private/blob/master/frontend/views/netflow-page.ts#L4-L7

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the interception you are referencing would be the easiest way to solve it, if there would be only one (or a few requests) that would be triggered.

The problem I ran into is there are like 60 request done on which it is necessary to wait. In theory, it could be implemented in a way that I count all the requests that are being done and wait for the exact amount to be finished, but I believe that could be quite easy to break if something in the implementation of how the data is fetched, which is not really a subject this test case.

So essentially this implementation waiting until the network is idle for some time. Once it is idle, it assumes the all of the data-fetching is done and would stop waiting.

Copy link
Member

Choose a reason for hiding this comment

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

got it, thanks for the explanation.

@memodi
Copy link
Member

memodi commented Oct 7, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 7, 2025
@memodi memodi added the approved label Oct 9, 2025
Copy link

openshift-ci bot commented Oct 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

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

@openshift-merge-bot openshift-merge-bot bot merged commit a86823d into netobserv:main Oct 9, 2025
13 checks passed
@oliver-smakal oliver-smakal deleted the NETOBSERV-2252 branch October 10, 2025 09:18
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.

4 participants