Repository navigation
chore(test): consolidate shared test utilities - #701
google-oss-prow[bot] merged 6 commits into
Conversation
|
🎉 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:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
8806a91 to
db167b3
Compare
|
@ChandelAnushka: GitHub didn't allow me to request PR reviews from the following users: Goku2099. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this: 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. |
|
cc @Goku2099 |
|
/ok-to-test |
|
Fixing the unit-test cases and working upon resolving conflicts. |
I think you should rebase your branch as well. |
9fceaee to
840e2c6
Compare
|
Sure, done @Goku2099. Please review once available, thanks! |
| @@ -0,0 +1,37 @@ | |||
| # Copyright 2025 The Kubeflow Authors. | |||
There was a problem hiding this comment.
| # Copyright 2025 The Kubeflow Authors. | |
| # Copyright The Kubeflow Authors. |
Could you remove the year from the copyright header?
There was a problem hiding this comment.
@tariq-hasan We need to integrate this script to our CI in SDK/Trainer: https://github.com/kubeflow/testing/blob/master/hack/boilerplate/boilerplate.py
|
Sure, updating. |
840e2c6 to
99ac106
Compare
| __test__ = False | ||
| # Common helpers have moved to kubeflow.common.testing. | ||
|
|
||
| from kubeflow.common.testing import ( # noqa: F401 |
There was a problem hiding this comment.
@andreyvelich Should we keep these as re-exports, or should we update all imports to use kubeflow.common.testing directly?
There was a problem hiding this comment.
Actually we do not need this compatibility shim since this is an internal test module without any external contract. So it ought to be removed.
99ac106 to
2f56a2e
Compare
|
/retitle chore(test): consolidate shared test utilities |
3a8aa41 to
f5aeb5c
Compare
|
Looks good! @ChandelAnushka |
|
@tariq-hasan Please let me know if we are good to merge, or if any other changes are required. |
andreyvelich
left a comment
There was a problem hiding this comment.
I left one question @ChandelAnushka @tariq-hasan.
|
@ChandelAnushka Could you also rebase your PR please? |
Move TestCase, SUCCESS, FAILED, DEFAULT_NAMESPACE, TIMEOUT, and RUNTIME from kubeflow.trainer.test.common and kubeflow.spark.test.common into a shared kubeflow.common.testing module. Update all 15 test files to import from the new location. Original modules are kept as thin re-export shims for backward compatibility. Closes kubeflow#700 Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
Address review feedback on kubeflow#701. Move `kubeflow/common/testing.py` to `test/testing.py` since it is an internal test helper rather than part of the shipped package, and update all test modules to import from the new location. Remove the `kubeflow/trainer/test` and `kubeflow/spark/test` compatibility shims; these are internal test modules with no external contract. The `SPARK_CONNECT_*` constants move to `kubeflow/spark/backends/kubernetes/backend_test.py`, their only consumer. Also drop the redundant empty `kubeflow/spark/tests` directory, add `test` to ruff's known-first-party list so imports sort consistently, and point `AGENTS.md` at the new helper location. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
…ts from wheel - Rename test/testing.py to test/common.py per review feedback - Update all imports across trainer, spark, optimizer, hub, and common tests - Update AGENTS.md/CLAUDE.md references - Exclude *_test.py files from the built wheel via hatch build config Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
f5aeb5c to
92e2286
Compare
Relocate the shared test package from the repo root test/ into kubeflow/test/ so it lives inside the main package, per review feedback. Update all test imports to kubeflow.test.common, adjust e2e paths in CI/scripts/docs, drop 'test' from isort first-party, and exclude kubeflow/test from the built wheel. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
Add year-less license headers to the new kubeflow/test __init__ files, drop the hardcoded year from the moved e2e modules, fix EXAMPLES_DIR to account for the deeper path, and exclude kubeflow/test/e2e from 'make test-python' so the unit job no longer collects cluster-dependent e2e tests. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
96a320e to
4167c32
Compare
| @@ -1,4 +1,4 @@ | |||
| # Copyright 2025 The Kubeflow Authors. | |||
| # Copyright The Kubeflow Authors. | |||
There was a problem hiding this comment.
@tariq-hasan @Shekharrajak @kubeflow/kubeflow-sdk-team @ChandelAnushka Do we want to move the E2E tests as part of this PR since we are going to delete them in any case after this: #812?
There was a problem hiding this comment.
Makes sense to not move the E2E tests. I have clarified the scope of the move with @ChandelAnushka in #701 (comment).
There was a problem hiding this comment.
Sure, updating.
Reverts the relocation of E2E tests into kubeflow/test/e2e per review: the E2E suite stays at the top-level test/ directory while only the shared unit-test helper lives under kubeflow/test/common.py. Restores the E2E files to their original content (including the EXAMPLES_DIR path) and the Makefile, CI workflow, and e2e-setup-cluster.sh references. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com>
d93ea72 to
d8df9f5
Compare
|
Thanks @ChandelAnushka! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich 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 |
* feat: move shared Spark and Trainer test helpers to kubeflow.common Move TestCase, SUCCESS, FAILED, DEFAULT_NAMESPACE, TIMEOUT, and RUNTIME from kubeflow.trainer.test.common and kubeflow.spark.test.common into a shared kubeflow.common.testing module. Update all 15 test files to import from the new location. Original modules are kept as thin re-export shims for backward compatibility. Closes kubeflow#700 Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> * chore(test): move shared test helpers to root test package Address review feedback on kubeflow#701. Move `kubeflow/common/testing.py` to `test/testing.py` since it is an internal test helper rather than part of the shipped package, and update all test modules to import from the new location. Remove the `kubeflow/trainer/test` and `kubeflow/spark/test` compatibility shims; these are internal test modules with no external contract. The `SPARK_CONNECT_*` constants move to `kubeflow/spark/backends/kubernetes/backend_test.py`, their only consumer. Also drop the redundant empty `kubeflow/spark/tests` directory, add `test` to ruff's known-first-party list so imports sort consistently, and point `AGENTS.md` at the new helper location. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> * chore(test): rename test/testing.py to test/common.py and exclude tests from wheel - Rename test/testing.py to test/common.py per review feedback - Update all imports across trainer, spark, optimizer, hub, and common tests - Update AGENTS.md/CLAUDE.md references - Exclude *_test.py files from the built wheel via hatch build config Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> * chore(test): move shared test helpers under kubeflow package Relocate the shared test package from the repo root test/ into kubeflow/test/ so it lives inside the main package, per review feedback. Update all test imports to kubeflow.test.common, adjust e2e paths in CI/scripts/docs, drop 'test' from isort first-party, and exclude kubeflow/test from the built wheel. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> * chore(test): fix boilerplate headers and exclude e2e from unit run Add year-less license headers to the new kubeflow/test __init__ files, drop the hardcoded year from the moved e2e modules, fix EXAMPLES_DIR to account for the deeper path, and exclude kubeflow/test/e2e from 'make test-python' so the unit job no longer collects cluster-dependent e2e tests. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> * chore(test): keep E2E tests at repo root Reverts the relocation of E2E tests into kubeflow/test/e2e per review: the E2E suite stays at the top-level test/ directory while only the shared unit-test helper lives under kubeflow/test/common.py. Restores the E2E files to their original content (including the EXAMPLES_DIR path) and the Makefile, CI workflow, and e2e-setup-cluster.sh references. Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> --------- Signed-off-by: Anushka Chandel <chandelanushka99@gmail.com> Signed-off-by: digvijay-y <144053736+digvijay-y@users.noreply.github.com>
What this PR does / why we need it:
Moves shared test utilities (
TestCase,SUCCESS,FAILED,DEFAULT_NAMESPACE,TIMEOUT,RUNTIME) fromkubeflow.trainer.test.commonandkubeflow.spark.test.commoninto a newkubeflow.common.testingmodule.Updates all 15 test files across trainer, spark, optimizer, hub, and common to import
from the shared location. Original modules are kept as thin re-export shims for
backward compatibility. Spark-specific constants (
SPARK_CONNECT_*) remain inkubeflow.spark.test.common.Which issue(s) this PR fixes:
Fixes #700
Checklist: