[SPARK-56407][BUILD][TESTS] Remove pre-built class files and JARs used in artifact transfer tests#55272
Closed
sarutak wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-56407][BUILD][TESTS] Remove pre-built class files and JARs used in artifact transfer tests#55272sarutak wants to merge 1 commit intoapache:masterfrom
sarutak wants to merge 1 commit intoapache:masterfrom
Conversation
Remove 2 pre-built JAR files (junitLargeJar.jar, smallJar.jar), 7 class files (Hello.class, HelloWithPackage.class, IntSumUdf.class, smallClassFile.class, smallClassFileDup.class), udf_noA.jar, and CRC files by dynamically generating them at test time. ArtifactManagerSuite generates real compiled classes (Hello, IntSumUdf via Scala, HelloWithPackage via Java). AddArtifactsHandlerSuite generates dummy byte arrays and computes CRC dynamically.
yaooqinn
approved these changes
Apr 9, 2026
HyukjinKwon
approved these changes
Apr 9, 2026
Member
|
Merged to master. |
Member
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 changes were proposed in this pull request?
This PR is a part of SPARK-56352 for artifact transfer test files, replacing pre-built .class files, JAR files, CRC files, and serialized binaries with dynamic generation at test time, removing 20 binary/text files from the repository.
Changes:
ArtifactManagerSuite(sql/core) to dynamically compile Java and Scala source files into .class files and JARs at test time usingcreateJarWithJavaSources()andcreateJarWithScalaSources().ArtifactSuite(sql/connect/client) to generate test artifacts(smallClassFile.class, smallJar.jar, largeJar.jar, etc.) in a temp directory and compute CRC values dynamically usingjava.util.zip.CRC32.ClassFinderSuite(sql/connect/client) to generate dummy .class files in a temp directory instead of reading from pre-built resources.AddArtifactsHandlerSuite(sql/connect/server) to generate test artifacts and CRC files dynamically in a temp directory.SparkConnectClientSuite(sql/connect/client) to use a dynamically generated temp file instead of referencing the deleted artifact-tests directory.test_artifact.py(PySpark) to generate test JAR files in a temp directory and compute CRC values dynamically usingzlib.crc32.dev/test-jars.txtanddev/test-classes.txtas all listed files are now removed.Note on test artifacts: The artifact transfer tests (ArtifactSuite, AddArtifactsHandlerSuite, test_artifact.py) only verify byte-level transfer protocol (chunking, CRC), so the generated .class files and JAR entries contain arbitrary bytes rather than valid Java class files. In contrast, ArtifactManagerSuite requires valid class files for classloader testing and uses createJarWithJavaSources()
/createJarWithScalaSources()` accordingly.Files removed:
data/artifact-tests/junitLargeJar.jardata/artifact-tests/smallJar.jardata/artifact-tests/crc/(3 files: README.md, junitLargeJar.txt, smallJar.txt)sql/connect/common/src/test/resources/artifact-tests/(11 files: Hello.class, smallClassFile.class, smallClassFileDup.class, smallJar.jar, junitLargeJar.jar, crc/*.txt)sql/core/src/test/resources/artifact-tests/(4 .class files: Hello.class, HelloWithPackage.class, IntSumUdf.class, smallClassFile.class)Why are the changes needed?
As noted in the PR discussion (#50378):
This PR completes that goal by removing all remaining pre-built test artifacts. After this change, no binary artifacts remain in the source tree for test purposes, and the release-time workaround (SPARK-51318) becomes fully unnecessary.
Note:
dev/test-jars.txtanddev/test-classes.txtare left as empty files becausedev/create-release/release-tag.shreads them withrm $(<dev/test-jars.txt), which would fail if the files were deleted. A follow-up PR will update the release script and remove these files.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
Kiro CLI / Opus 4.6