[SPARK-55306][PYTHON][TESTS][FOLLOW-UP] Skip Kafka streaming RTM tests when dependencies are not installed#55270
Conversation
…ndencies are not installed Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
|
cc @jerrypeng |
|
Can we check whether this PR is doing the same work with above? |
The PR added the test code passed all CIs. Is the failed pipeline not running on the PR? |
|
@HeartSaVioR just notice #55266, I think we don't need this PR now.
yes, it is failed on scheduled workflows. |
@zhengruifeng why would it succeed for PRs but fail for scheduled workflows? |
|
@jerrypeng because you didn't install the dependency in all scheduled workflow, e.g. https://github.com/apache/spark/actions/workflows/build_python_3.12 |
What changes were proposed in this pull request?
Skip
StreamingKafkaTestsintest_streaming_kafka_rtm.pywhentestcontainersorkafka-pythonis not installed, instead of raising anImportErrorthat crashes the entire test module.Why are the changes needed?
The CI job
pyspark-structured-streamingfails becausetest_streaming_kafka_rtm.pyraisesImportErrorat module level whentestcontainersis not installed. This causes the entire test runner to exit with a non-zero code, failing the CI build. See: https://github.com/apache/spark/actions/runs/24128422095/job/70399041605Does this PR introduce any user-facing change?
No.
How was this patch tested?
The test class is now decorated with
@unittest.skipIf(not have_kafka_deps, ...), which gracefully skips when the dependencies are missing — the same pattern used for Docker availability in the same file.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code