Skip to content

Conversation

@sradco
Copy link
Collaborator

@sradco sradco commented Dec 30, 2025

What this PR does / why we need it:
This PR adds e2e test for Perses dashboards and datasource
deployment.
It checks that they will be deployed only when the CRDs exist.

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Jira Ticket:

https://issues.redhat.com/browse/CNV-75759

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 30, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @sradco, your pull request is larger than the review limit of 150000 diff characters

@coveralls
Copy link
Collaborator

coveralls commented Dec 30, 2025

Pull Request Test Coverage Report for Build 21205982802

Details

  • 19 of 28 (67.86%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 76.016%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/perses/perses_controller.go 3 4 75.0%
controllers/crd/crd_controller.go 5 9 55.56%
pkg/util/cluster.go 11 15 73.33%
Files with Coverage Reduction New Missed Lines %
pkg/util/cluster.go 1 88.1%
Totals Coverage Status
Change from base Build 21196835008: -0.02%
Covered Lines: 8510
Relevant Lines: 11195

💛 - Coveralls

@sradco
Copy link
Collaborator Author

sradco commented Dec 30, 2025

@nunnatsa Hi, Please review this PR. Thank you

defer f.Close()

dec := yaml.NewYAMLOrJSONDecoder(f, 4096)
for {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need a loop here? it's single file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from cb285e5 to e523265 Compare December 30, 2025 12:18
@sradco sradco changed the title Fix bug in perses deployment and add e2e test Add e2e test for Perses dashboards deployment Dec 30, 2025
@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from e523265 to c1cde70 Compare December 30, 2025 12:24
@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch 3 times, most recently from 6cd8575 to d4bac49 Compare December 30, 2025 12:44
@hco-bot
Copy link
Collaborator

hco-bot commented Dec 30, 2025

hco-e2e-upgrade-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure
hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure, ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure

Details

In response to this:

hco-e2e-upgrade-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure
hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 30, 2025

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

Details

In response to this:

hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 30, 2025

hco-e2e-operator-sdk-gcp, hco-e2e-operator-sdk-aws lanes succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure
hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure
hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-azure, ci/prow/hco-e2e-upgrade-operator-sdk-azure, ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

Details

In response to this:

hco-e2e-operator-sdk-gcp, hco-e2e-operator-sdk-aws lanes succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure
hco-e2e-upgrade-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-operator-sdk-azure
hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 30, 2025

hco-e2e-consecutive-operator-sdk-upgrades-azure lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-aws

Details

In response to this:

hco-e2e-consecutive-operator-sdk-upgrades-azure lane succeeded.
/override ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 30, 2025

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Added some more comments inline.

@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from b30274b to fa7a235 Compare December 31, 2025 10:03
Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Thanks @sradco - added few more comments.

@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from fa7a235 to 7a35e3e Compare December 31, 2025 11:59
Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Thanks @sradco - looks good!

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 31, 2025
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 31, 2025
@hco-bot
Copy link
Collaborator

hco-bot commented Dec 31, 2025

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Dec 31, 2025

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from 7a35e3e to d11443b Compare January 18, 2026 12:50
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2026
@kubevirt-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2026

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from d11443b to e757a9b Compare January 18, 2026 15:55
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2026

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2026

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

Details

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

This PR fixes the logic of when we deploy the
Perses dashboards and datasource and
add e2e test for checking they are deplyed only
when the perses CRD exists.

Signed-off-by: Shirly Radco <[email protected]>
@sradco sradco force-pushed the add_e2e_tests_for_perses_crs_deployment branch from e757a9b to a57d07d Compare January 21, 2026 10:25
@sonarqubecloud
Copy link


// Skip registration cleanly when Perses CRDs are not installed (e.g., unit/CI envs)
if !checkPersesAvailable(context.Background(), mgr.GetClient()) {
available := checkPersesAvailable(ctx, mgr.GetClient())
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this phase, the mgr.Client cache is not populate yet. You'll need to use the apiClient from main (pass it as a parameter to SetupPersesWithManager; e.g.

func SetupPersesWithManager(ctx context.Context, uncachedClient client.Client, mgr manager.Manager, ownerRef metav1.OwnerReference) error {

And in main:

if err = perses.SetupPersesWithManager(ctx, apiClient, mgr, ownresources.GetDeploymentRef()); err != nil {

then use it here:

Suggested change
available := checkPersesAvailable(ctx, mgr.GetClient())
available := checkPersesAvailable(ctx, uncachedClient)

Comment on lines +38 to +40
DeferCleanup(func(ctx context.Context) {
tests.DumpHCOPodLogs(ctx, "after perses dynamic CRD gating", tests.LogCaptureOptions{Since: &testStart, IncludePrevious: true})
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you should move this code into the other DeferCleanup call.

@openshift-ci
Copy link

openshift-ci bot commented Jan 21, 2026

@sradco: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-upgrade-operator-sdk-aws a57d07d link true /test hco-e2e-upgrade-operator-sdk-aws
ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws a57d07d link false /test hco-e2e-upgrade-prev-operator-sdk-sno-aws
ci/prow/hco-e2e-operator-sdk-sno-azure a57d07d link false /test hco-e2e-operator-sdk-sno-azure
ci/prow/hco-e2e-operator-sdk-sno-aws a57d07d link false /test hco-e2e-operator-sdk-sno-aws
ci/prow/hco-e2e-operator-sdk-aws a57d07d link true /test hco-e2e-operator-sdk-aws
ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure a57d07d link false /test hco-e2e-upgrade-operator-sdk-sno-azure
ci/prow/hco-e2e-upgrade-prev-operator-sdk-aws a57d07d link true /test hco-e2e-upgrade-prev-operator-sdk-aws
ci/prow/hco-e2e-operator-sdk-azure a57d07d link true /test hco-e2e-operator-sdk-azure
ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure a57d07d link true /test hco-e2e-upgrade-prev-operator-sdk-azure
ci/prow/hco-e2e-upgrade-operator-sdk-sno-aws a57d07d link false /test hco-e2e-upgrade-operator-sdk-sno-aws
ci/prow/hco-e2e-upgrade-operator-sdk-azure a57d07d link true /test hco-e2e-upgrade-operator-sdk-azure
ci/prow/hco-e2e-operator-sdk-gcp a57d07d link true /test hco-e2e-operator-sdk-gcp
ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure a57d07d link false /test hco-e2e-upgrade-prev-operator-sdk-sno-azure
ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-aws a57d07d link true /test hco-e2e-consecutive-operator-sdk-upgrades-aws
ci/prow/hco-e2e-consecutive-operator-sdk-upgrades-azure a57d07d link true /test hco-e2e-consecutive-operator-sdk-upgrades-azure
ci/prow/hco-e2e-kv-smoke-gcp a57d07d link true /test hco-e2e-kv-smoke-gcp

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 21, 2026

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp

Details

In response to this:

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

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.

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note-none Denotes a PR that doesn't merit a release note. size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants