Skip to content

chore: fix integration tests v1alpha3 and v1alpha4 - #1451

Merged
openshift-merge-bot[bot] merged 3 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:fix-integration-tests-v1alpha3-and-v1alpha4
Jul 25, 2025
Merged

chore: fix integration tests v1alpha3 and v1alpha4#1451
openshift-merge-bot[bot] merged 3 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:fix-integration-tests-v1alpha3-and-v1alpha4

Conversation

@Fortune-Ndlovu

@Fortune-Ndlovu Fortune-Ndlovu commented Jul 25, 2025

Copy link
Copy Markdown
Member

Description

This PR fixes failing integration tests by registering all API versions (v1alpha1-v1alpha4) in the Kubernetes client scheme, resolving the "no kind is registered for the type v1alpha3.Backstage" error. Additionally, it improves test organization by moving the API compatibility test from config-refresh_test.go to a dedicated cr-compatibility_test.go file, ensuring each test file has a clear, focused purpose.

Which issue(s) does this PR fix or relate to

https://issues.redhat.com/browse/RHDHBUGS-1907

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

Summary by Sourcery

Extract and centralize API version compatibility tests, update test scheme registration, and refresh generated deepcopy code

Enhancements:

  • Move v1alpha3 and v1alpha4 compatibility test from config-refresh into its own cr-compatibility_test.go file
  • Register v1alpha1, v1alpha2, and v1alpha3 API versions in the integration test suite scheme

Tests:

  • Add a dedicated integration test for verifying CR compatibility between v1alpha3 and v1alpha4

Chores:

  • Regenerate deepcopy methods for API types v1alpha1 through v1alpha4

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…test.go since its not related to config refresh functionality, need its own file.

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
@sourcery-ai

sourcery-ai Bot commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Refactor integration tests by extracting v1alpha3/v1alpha4 compatibility tests into a dedicated file, register all API versions in the test suite, and regenerate deep-copy code for v1alpha1–v1alpha4.

File-Level Changes

Change Details Files
Extracted and removed compatibility tests from config-refresh suite
  • Deleted mixed v1alpha3/v1alpha4 compatibility It() block
  • Removed v1alpha3 and metav1 imports
integration_tests/config-refresh_test.go
Added standalone compatibility test file
  • Created dedicated test for v1alpha3 and v1alpha4 coexistence
  • Copied and adapted existing test logic into new file
integration_tests/cr-compatibility_test.go
Registered all API versions in test suite
  • Imported v1alpha1, v1alpha2, v1alpha3 APIs
  • Called AddToScheme for v1alpha1–v1alpha3 in BeforeSuite
integration_tests/suite_test.go
Regenerated deepcopy code for all API versions
  • Updated zz_generated.deepcopy.go for v1alpha1–v1alpha4
api/v1alpha1/zz_generated.deepcopy.go
api/v1alpha2/zz_generated.deepcopy.go
api/v1alpha3/zz_generated.deepcopy.go
api/v1alpha4/zz_generated.deepcopy.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @Fortune-Ndlovu - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
@Fortune-Ndlovu Fortune-Ndlovu self-assigned this Jul 25, 2025

@rm3l rm3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks.

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 25, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit aca97c1 into redhat-developer:main Jul 25, 2025
7 checks passed
Fortune-Ndlovu added a commit to Fortune-Ndlovu/rhdh-operator that referenced this pull request Sep 6, 2025
…1451)

* ensure all api versions are properly registered

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>

* update: the api compatibility test does not belong in config-refresh_test.go since its not related to config refresh functionality, need its own file.

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>

* naming issue

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>

---------

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
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.

2 participants