Skip to content

SANDBOX-1769 | chore: tests for "disable integrations" changes#1274

Open
MikelAlejoBR wants to merge 1 commit intocodeready-toolchain:masterfrom
MikelAlejoBR:SANDBOX-1769-chore-tests-for-disable-integrations-ui
Open

SANDBOX-1769 | chore: tests for "disable integrations" changes#1274
MikelAlejoBR wants to merge 1 commit intocodeready-toolchain:masterfrom
MikelAlejoBR:SANDBOX-1769-chore-tests-for-disable-integrations-ui

Conversation

@MikelAlejoBR
Copy link
Copy Markdown
Contributor

@MikelAlejoBR MikelAlejoBR commented Apr 17, 2026

The "disable integrations" feature allows disabling integrations by changing the "ToolchainConfig" resource. The goal of this test is to verify that the CRD key is there, and that it is empty, since the E2E tests should not have any integrations disabled.

Related PRs

Jira ticket

[SANDBOX-1769]

Summary by CodeRabbit

  • Tests
    • Enhanced test validation for UI configuration API response to verify the presence and structure of the disabledIntegrations field.

The "disable integrations" feature allows disabling integrations by
changing the "ToolchainConfig" resource. The goal of this test is to
verify that the CRD key is there, and that it is empty, since the E2E
tests should not have any integrations disabled.

SANDBOX-1769
@openshift-ci openshift-ci bot requested review from rsoaresd and xcoulon April 17, 2026 19:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 17, 2026

Walkthrough

The test TestUIConfig in the registration service E2E test suite is enhanced to validate an additional field in the UIConfig API response. The test now asserts the presence and type of a disabledIntegrations field alongside existing assertions.

Changes

Cohort / File(s) Summary
Test Updates
test/e2e/parallel/registration_service_test.go
Added assertions in TestUIConfig to validate that the GET /api/v1/uiconfig response includes a disabledIntegrations field and that it is of array type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding tests for the disable integrations feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/e2e/parallel/registration_service_test.go`:
- Around line 1019-1022: The test currently checks that the uiconfig response
contains "disabledIntegrations" and that it's an array (variable
disabledIntegrations); add an assertion that this array is empty to match the
test intent. Update the assertions after the IsType check (e.g., use
require.Empty(t, disabledIntegrations) or require.Len(t, disabledIntegrations,
0)) so the test fails if any integration is unexpectedly disabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c1f3780c-bc1d-4081-9b5d-7ed8ab2103ea

📥 Commits

Reviewing files that changed from the base of the PR and between 88eb7f8 and 4c6b47a.

📒 Files selected for processing (1)
  • test/e2e/parallel/registration_service_test.go

Comment on lines +1019 to +1022
// verify that disabledIntegrations is present and is an array
disabledIntegrations, ok := response["disabledIntegrations"]
require.True(t, ok, "disabledIntegrations field should be present in uiconfig response")
require.IsType(t, []interface{}{}, disabledIntegrations, "disabledIntegrations should be an array")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Also assert that disabledIntegrations is empty.

The PR description states the test should verify both that the field is present and that it is empty (since E2E tests shouldn't have any integrations disabled). The current assertions only check presence and type — consider adding an emptiness check to match the stated intent and catch regressions where an integration gets inadvertently disabled in the E2E config.

Proposed change
 		// verify that disabledIntegrations is present and is an array
 		disabledIntegrations, ok := response["disabledIntegrations"]
 		require.True(t, ok, "disabledIntegrations field should be present in uiconfig response")
 		require.IsType(t, []interface{}{}, disabledIntegrations, "disabledIntegrations should be an array")
+		assert.Empty(t, disabledIntegrations.([]interface{}), "E2E tests should not have any disabled integrations")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// verify that disabledIntegrations is present and is an array
disabledIntegrations, ok := response["disabledIntegrations"]
require.True(t, ok, "disabledIntegrations field should be present in uiconfig response")
require.IsType(t, []interface{}{}, disabledIntegrations, "disabledIntegrations should be an array")
// verify that disabledIntegrations is present and is an array
disabledIntegrations, ok := response["disabledIntegrations"]
require.True(t, ok, "disabledIntegrations field should be present in uiconfig response")
require.IsType(t, []interface{}{}, disabledIntegrations, "disabledIntegrations should be an array")
assert.Empty(t, disabledIntegrations.([]interface{}), "E2E tests should not have any disabled integrations")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/parallel/registration_service_test.go` around lines 1019 - 1022, The
test currently checks that the uiconfig response contains "disabledIntegrations"
and that it's an array (variable disabledIntegrations); add an assertion that
this array is empty to match the test intent. Update the assertions after the
IsType check (e.g., use require.Empty(t, disabledIntegrations) or require.Len(t,
disabledIntegrations, 0)) so the test fails if any integration is unexpectedly
disabled.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MikelAlejoBR

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-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 17, 2026

@MikelAlejoBR: The following test 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/e2e 4c6b47a link true /test e2e

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants