fix: strip Java WARNING lines from golden files and regenerate error goldens#962
Open
He-Pin wants to merge 1 commit into
Open
fix: strip Java WARNING lines from golden files and regenerate error goldens#962He-Pin wants to merge 1 commit into
He-Pin wants to merge 1 commit into
Conversation
…goldens Motivation: JDK 21+ emits sun.misc.Unsafe deprecation warnings to stderr. The golden generation script captures stderr via 2>&1, contaminating golden files with WARNING: lines. Also, sync_test_suites.sh copies upstream error goldens as-is, but go-jsonnet's error format (RUNTIME ERROR:) differs from sjsonnet's (sjsonnet.Error:). Modification: - Add sed filter to strip WARNING: lines in refresh_golden_outputs.sh (all 3 loops: specific-files, test_suite, go_test_suite) - Add error golden auto-regeneration in sync_test_suites.sh for newly synced upstream error tests Result: Golden files are clean of JDK version-specific warnings. New upstream error tests get sjsonnet-format goldens automatically on sync.
92453a6 to
fbb5082
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.
Motivation
JDK 21+ emits
sun.misc.Unsafe::objectFieldOffsetdeprecation warnings to stderr.refresh_golden_outputs.shcaptures stderr via2>&1, contaminating golden files withWARNING:lines that cause test failures on different JDK versions. Additionally,sync_test_suites.shcopies upstream error goldens as-is, but go-jsonnet's error format (RUNTIME ERROR:) differs from sjsonnet's (sjsonnet.Error:), causing mismatches for newly synced tests.Modification
sed -i '' '/^WARNING:/d'after each golden generation inrefresh_golden_outputs.sh(all 3 loops: specific-files, test_suite, go_test_suite/new_test_suite)sync_test_suites.sh: when a new upstream error test is copied, detect it viais_success_goldenand queue it for regeneration with sjsonnet's own error formatResult
Golden files are clean of JDK version-specific warnings. New upstream error tests automatically get sjsonnet-format goldens on sync, eliminating manual regeneration steps.
Test plan
refresh_golden_outputs.shproduces clean goldens (noWARNING:lines)sync_test_suites.shauto-regenerates error goldens for new upstream tests