Skip to content

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

Merged
MikelAlejoBR merged 2 commits into
codeready-toolchain:masterfrom
MikelAlejoBR:SANDBOX-1769-chore-tests-for-disable-integrations-ui
Apr 27, 2026
Merged

SANDBOX-1769 | chore: tests for "disable integrations" changes#1274
MikelAlejoBR merged 2 commits into
codeready-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 checks for the UI configuration API response to ensure the disabledIntegrations field is present and is an array, in addition to existing validations. This strengthens validation around UI configuration payloads.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: d01d36d5-5a63-47b8-8385-4266b66d5a02

📥 Commits

Reviewing files that changed from the base of the PR and between 4c6b47a and 527b671.

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

Walkthrough

The E2E test TestUIConfig for the registration service now checks the /api/v1/uiconfig response includes a disabledIntegrations field and asserts that this field is a JSON array, in addition to existing assertions.

Changes

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

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

test, chore

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding tests for the 'disable integrations' feature as shown in the raw summary which validates the disabledIntegrations field in the test.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

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.

Copy link
Copy Markdown
Contributor

@metlos metlos left a comment

Choose a reason for hiding this comment

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

Looks good.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, metlos, 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:
  • OWNERS [alexeykazakov,metlos]

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

@coderabbitai coderabbitai Bot added test Work that adds, fixes, or maintains automated tests or coverage (unit, integration, e2e, flakiness) chore Routine repo or tooling maintenance labels Apr 27, 2026
@sonarqubecloud
Copy link
Copy Markdown

@MikelAlejoBR
Copy link
Copy Markdown
Contributor Author

/retest

@MikelAlejoBR MikelAlejoBR merged commit 86a74db into codeready-toolchain:master Apr 27, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved chore Routine repo or tooling maintenance test Work that adds, fixes, or maintains automated tests or coverage (unit, integration, e2e, flakiness)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants