Skip to content

Conversation

@logonoff
Copy link
Member

@logonoff logonoff commented Feb 9, 2026

Follow up on #15817 by fixing skipped unit tests. The SDK-releated tests that are skipped in that PR are removed in #15904

Summary by CodeRabbit

  • Tests

    • Migrated test suite to use standard testing library utilities instead of local helpers.
    • Updated test interactions to use async/await patterns for improved reliability.
    • Re-enabled previously skipped test cases for deployment and resource creation scenarios.
  • Chores

    • Removed deprecated local test helper module.
    • Updated test mocking patterns for consistency across test suites.

logonoff and others added 3 commits February 9, 2026 10:17
Update test mocks to properly handle internal module function calls:
- Use k8sCreateMock to return correct shape for ImageStreamModel in
  Knative test (internal calls bypass Jest module mocks)
- Use k8sCreateMock to reject for DeploymentModel in error test
- Add createOrUpdateImageStreamMock setup in beforeAll for test isolation
- Add assertions to verify Knative functions are called
- Remove unused createOrUpdateDeploymentMock

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 9, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 9, 2026

@logonoff: This pull request references CONSOLE-4991 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

This pull request references ODC-6264 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.22." or "openshift-4.22.", but it targets "openshift-4.11" instead.

Details

In response to this:

Follow up on #15817 by fixing skipped unit tests. The SDK-releated tests that are skipped in that PR are removed in #15904

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 9, 2026

@logonoff: This pull request references CONSOLE-4991 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

This pull request references ODC-6264 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.22." or "openshift-4.22.", but it targets "openshift-4.11" instead.

Details

In response to this:

Follow up on #15817 by fixing skipped unit tests. The SDK-releated tests that are skipped in that PR are removed in #15904

Summary by CodeRabbit

  • Tests

  • Migrated test suite to use standard testing library utilities instead of local helpers.

  • Updated test interactions to use async/await patterns for improved reliability.

  • Re-enabled previously skipped test cases for deployment and resource creation scenarios.

  • Chores

  • Removed deprecated local test helper module.

  • Updated test mocking patterns for consistency across test suites.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jhadvig and spadgett February 9, 2026 20:20
@openshift-ci openshift-ci bot added component/dev-console Related to dev-console approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

This pull request removes a local synchronous userEvent test helper and migrates the test suite to the official @testing-library/user-event library. The custom shim in user-event.ts (67 lines) is deleted entirely. Across eleven test files in buildconfig sections and import utilities, imports are updated to reference the official testing library, and all userEvent interactions (click, type operations) are converted to async/await patterns. Additionally, previously skipped tests in import submit utilities are re-enabled with proper async mock implementations for resource creation flows.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly references the Jest 30 migration followup work and maps directly to the PR's objectives of fixing skipped unit tests and removing custom user-event implementations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
frontend/packages/dev-console/src/components/buildconfig/sections/__tests__/PolicySection.spec.tsx (1)

3-67: Prefer userEvent.setup() per test to align with @testing-library/user-event v14 best practices.

Direct userEvent.click(...) calls remain supported in v14, but the recommended pattern is const user = userEvent.setup(); followed by await user.click(...). This instance-based approach ensures consistent input device state across multiple interactions and applies document-level workarounds predictably. Consider refactoring this test (and similar patterns throughout the suite) to use the setup instance for improved maintainability and reliability.

frontend/packages/dev-console/src/components/import/__tests__/upload-jar-submit-utils.spec.ts (1)

106-108: Make the ImageStream mock closer to real shape.

Consider adding a minimal status (e.g., dockerImageReference) to the default mock to reduce brittleness if future tests rely on it.

♻️ Suggested tweak
 createOrUpdateImageStreamMock.mockImplementation(() =>
-  Promise.resolve({ model: ImageStreamModel, data: {}, dryRun: false }),
+  Promise.resolve({
+    model: ImageStreamModel,
+    data: {},
+    dryRun: false,
+    status: { dockerImageReference: 'test:1234' },
+  }),
 );
frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts (1)

138-140: Align default ImageStream mock with Knative path expectations.

createOrUpdateResources reads imageStreamResponse.status.dockerImageRepository in the Knative path. Adding it here reduces fragility if tests or ordering change.

♻️ Suggested tweak
 createOrUpdateImageStreamMock.mockImplementation(() =>
-  Promise.resolve({ model: ImageStreamModel, data: {}, dryRun: false }),
+  Promise.resolve({
+    model: ImageStreamModel,
+    data: {},
+    dryRun: false,
+    status: { dockerImageRepository: 'test:1234' },
+  }),
 );

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

@logonoff: 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/e2e-gcp-console 73b9d2d link true /test e2e-gcp-console
ci/prow/okd-scos-images 73b9d2d link true /test okd-scos-images

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.

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2026
@logonoff
Copy link
Member Author

/label px-approved
/label docs-approved
/verified by CI

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, TheRealJon

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 openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Feb 10, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 10, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/label px-approved
/label docs-approved
/verified by CI

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 openshift-eng/jira-lifecycle-plugin 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. component/dev-console Related to dev-console docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants