SANDBOX-1769 | chore: tests for "disable integrations" changes#1274
Conversation
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
WalkthroughThe test Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
test/e2e/parallel/registration_service_test.go
| // 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") |
There was a problem hiding this comment.
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.
| // 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.
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@MikelAlejoBR: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |



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