Skip to content

chore(test): consolidate shared test utilities - #701

Merged
google-oss-prow[bot] merged 6 commits into
kubeflow:mainfrom
ChandelAnushka:feat/move-shared-test-helpers
Oct 6, 2026
Merged

google-oss-prow[bot] merged 6 commits into
kubeflow:mainfrom
ChandelAnushka:feat/move-shared-test-helpers

Conversation

@ChandelAnushka

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Moves shared test utilities (TestCase, SUCCESS, FAILED, DEFAULT_NAMESPACE,
TIMEOUT, RUNTIME) from kubeflow.trainer.test.common and
kubeflow.spark.test.common into a new kubeflow.common.testing module.

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 in
kubeflow.spark.test.common.

Which issue(s) this PR fixes:

Fixes #700

Checklist:

  • Docs included if any changes are user facing
    • N/A — internal test utilities only, no user-facing changes

@google-oss-prow
google-oss-prow Bot requested review from fege and szaher August 1, 2026 07:34
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
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! 🙏

@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch 3 times, most recently from 8806a91 to db167b3 Compare August 1, 2026 07:41
@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

/cc @andreyvelich @Goku2099

@google-oss-prow
google-oss-prow Bot requested a review from andreyvelich August 1, 2026 07:44
@google-oss-prow

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

/cc @andreyvelich @Goku2099

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.

@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

cc @Goku2099

@Goku2099

Goku2099 commented Aug 7, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

Fixing the unit-test cases and working upon resolving conflicts.

@Goku2099

Goku2099 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Fixing the unit-test cases and working upon resolving conflicts.

I think you should rebase your branch as well.

@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch 2 times, most recently from 9fceaee to 840e2c6 Compare August 7, 2026 15:11
@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

Sure, done @Goku2099. Please review once available, thanks!

@Goku2099 Goku2099 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this PR! I have one small suggestion:

Comment thread kubeflow/common/testing.py Outdated
@@ -0,0 +1,37 @@
# Copyright 2025 The Kubeflow Authors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# Copyright 2025 The Kubeflow Authors.
# Copyright The Kubeflow Authors.

Could you remove the year from the copyright header?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Ashvatthaa is assigned to the issue: #568.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Goku2099 Done.

@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

Sure, updating.

@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch from 840e2c6 to 99ac106 Compare August 7, 2026 16:46
Comment thread kubeflow/trainer/test/common.py Outdated
__test__ = False
# Common helpers have moved to kubeflow.common.testing.

from kubeflow.common.testing import ( # noqa: F401

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@andreyvelich Should we keep these as re-exports, or should we update all imports to use kubeflow.common.testing directly?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch from 99ac106 to 2f56a2e Compare August 8, 2026 05:46
@tariq-hasan

Copy link
Copy Markdown
Member

/retitle chore(test): consolidate shared test utilities

@google-oss-prow google-oss-prow Bot changed the title feat: move shared Spark and Trainer test helpers to kubeflow.common chore(test): consolidate shared test utilities Sep 5, 2026
@Goku2099

Copy link
Copy Markdown
Member

Looks good! @ChandelAnushka
/lgtm

@google-oss-prow google-oss-prow Bot added the lgtm label Sep 10, 2026
@ChandelAnushka

Copy link
Copy Markdown
Contributor Author

@tariq-hasan Please let me know if we are good to merge, or if any other changes are required.

@github-project-automation github-project-automation Bot moved this to Ready to Merge in Kubeflow SDK Sep 21, 2026

@andreyvelich andreyvelich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I left one question @ChandelAnushka @tariq-hasan.

@andreyvelich

Copy link
Copy Markdown
Member

@ChandelAnushka Could you also rebase your PR please?

@tariq-hasan tariq-hasan moved this from Ready to Merge to Changes Requested in Kubeflow SDK Oct 4, 2026
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>
@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch from f5aeb5c to 92e2286 Compare October 5, 2026 03:55
@google-oss-prow google-oss-prow Bot removed the lgtm label Oct 5, 2026
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>
@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch from 96a320e to 4167c32 Compare October 5, 2026 04:12
@@ -1,4 +1,4 @@
# Copyright 2025 The Kubeflow Authors.
# Copyright The Kubeflow Authors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to not move the E2E tests. I have clarified the scope of the move with @ChandelAnushka in #701 (comment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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>
@ChandelAnushka
ChandelAnushka force-pushed the feat/move-shared-test-helpers branch from d93ea72 to d8df9f5 Compare October 6, 2026 03:01
@andreyvelich

Copy link
Copy Markdown
Member

Thanks @ChandelAnushka!
/lgtm
/approve

@google-oss-prow

Copy link
Copy Markdown
Contributor

[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

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

@google-oss-prow
google-oss-prow Bot merged commit 4633ad6 into kubeflow:main Oct 6, 2026
28 of 35 checks passed
@google-oss-prow google-oss-prow Bot added this to the v0.5 milestone Oct 6, 2026
digvijay-y pushed a commit to digvijay-y/sdk that referenced this pull request Oct 17, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Move shared Spark and Trainer test helpers to kubeflow.common

4 participants