Skip to content

chore(spark): Refactor unit tests to follow standards#314

Closed
priyank766 wants to merge 1 commit intokubeflow:mainfrom
priyank766:refactor/spark-tests-273
Closed

chore(spark): Refactor unit tests to follow standards#314
priyank766 wants to merge 1 commit intokubeflow:mainfrom
priyank766:refactor/spark-tests-273

Conversation

@priyank766
Copy link

What this PR does / why we need it:
This PR refactors the SparkClient unit tests in [kubeflow/spark/api/spark_client_test.py]
(kubeflow-sdk/kubeflow/spark/api/spark_client_test.py:0:0-0:0) to align with the standardized testing patterns used throughout the Kubeflow SDK.

Key changes include:

  • Replaced individual test methods for initialization and session management with unified parametrized tests using @pytest.mark.parametrize.
  • Utilized the TestCase dataclass and SUCCESS/FAILED constants from kubeflow.trainer.test.common for consistency across client test suites.
  • Improved code maintainability and readability by reducing boilerplate mock setups and consolidating logic.

Which issue(s) this PR fixes:
Fixes #273

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: priyank <priyank8445@gmail.com>
Copilot AI review requested due to automatic review settings February 22, 2026 09:29
@google-oss-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@github-actions
Copy link
Contributor

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the SparkClient unit tests to match the Kubeflow SDK’s standardized, parametrized TestCase pattern, reducing per-method boilerplate while keeping the same behavioral coverage targets.

Changes:

  • Replaced individual initialization tests with a single @pytest.mark.parametrize-driven test_spark_client_init.
  • Replaced session-management method tests with a single parametrized test_spark_client_session_management.
  • Adopted TestCase plus SUCCESS/FAILED constants from kubeflow.trainer.test.common for consistency.

@astefanutti
Copy link
Contributor

/retitle chore(spark): Refactor unit tests to follow standards

@google-oss-prow google-oss-prow bot changed the title test(spark): Refactor unit tests to follow standards (#273) chore(spark): Refactor unit tests to follow standards Feb 23, 2026
Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@astefanutti
Copy link
Contributor

@priyank766 can you rebase your PR, the e2e test should be fixed after.

@priyank766 priyank766 force-pushed the refactor/spark-tests-273 branch from ab886f2 to bc33273 Compare February 23, 2026 17:27
@priyank766
Copy link
Author

priyank766 commented Feb 23, 2026

@priyank766 can you rebase your PR, the e2e test should be fixed after.

Done @astefanutti

@andreyvelich
Copy link
Member

This is resolved in: #293
/close

@google-oss-prow google-oss-prow bot closed this Feb 27, 2026
@google-oss-prow
Copy link
Contributor

@andreyvelich: Closed this PR.

Details

In response to this:

This is resolved in: #293
/close

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/test-infra repository.

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.

test(spark): Refactor unit tests to follow Kubeflow SDK coding standards

4 participants