chore(spark): align test patterns and fix cross-module import - #677
Open
KartikSuryavanshi wants to merge 1 commit into
Open
chore(spark): align test patterns and fix cross-module import#677KartikSuryavanshi wants to merge 1 commit into
KartikSuryavanshi wants to merge 1 commit into
Conversation
google-oss-prow
Bot
requested review from
Electronic-Waste,
kramaranya and
szaher
July 28, 2026 09:55
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
KartikSuryavanshi
force-pushed
the
test/spark-align-test-patterns
branch
from
July 28, 2026 10:06
2e8d340 to
e897a81
Compare
- Fix cross-module import in types_test.py: import from kubeflow.spark.test.common instead of kubeflow.trainer.test.common - Migrate 16 try/except blocks to pytest.raises() in backend_test.py for cleaner error assertion patterns - Replace string-based branching with data-driven expected_output assertions in utils_test.py (test_build_spark_connect_cr, test_get_spark_connect_info_from_cr, test_resolve_driver_resources, test_resolve_executor_resources, etc.) - Remove redundant assert test_case.expected_status == SUCCESS checks where pytest.raises() already handles the error path Part of kubeflow#609 Signed-off-by: Kartik Suryavanshi <158498247+KartikSuryavanshi@users.noreply.github.com>
KartikSuryavanshi
force-pushed
the
test/spark-align-test-patterns
branch
from
July 28, 2026 10:07
e897a81 to
fb257ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR addresses test pattern alignment and a cross-module import bug as part of #609.
Changes:
Fix cross-module import in
types_test.py: Import fromkubeflow.spark.test.commoninstead ofkubeflow.trainer.test.commonto remove unnecessary coupling with the Trainer package.Migrate try/except to pytest.raises() in
backend_test.py: Replaced 16 try/except blocks withpytest.raises()context managers for cleaner error assertion patterns, matching the Trainer SDK test style.Replace string-based branching in
utils_test.py: Converted string-basedif/elifontest_case.nameto data-drivenexpected_outputassertions in:test_build_spark_connect_cr(14 branches to dictionary-based assertions)test_get_spark_connect_info_from_cr(5 branches to generic field checks)test_resolve_driver_resources(3 branches to config-based checks)test_resolve_executor_resources(4 branches to config-based checks)test_generate_session_name,test_generate_job_name,test_build_service_url,test_read_pod_logsRemove redundant assertions: Removed
assert test_case.expected_status == SUCCESSwherepytest.raises()already handles the error path.Validation:
Part of #609