Make parameterized test names deterministic#1498
Merged
liblit merged 1 commit intowala:masterfrom Apr 26, 2025
Merged
Conversation
Previously several parameterized tests used `List`s of items without custom `toString` methods. Including these in test names led to generated test names like `java17IRTestName=CatchMultipleExceptionTypes, ca=[com.ibm.wala.cast.java.test.ECJJava17IRTest$3@6e576b5a]`, where the `6e576b5a` part varied randomly from one run to the next. That nondeterminism, in turn, led to misleading claims of test churn in test reports. For example, [this report](wala#1495 (comment)) states that "this pull request removes 118 and adds 118 tests." No tests were actually removed, though: 118 tests simply changed the hex digits in their names. Now we customize the name template for some parameterized tests to omit items with nondeterministic `toString` results. This change should give us test reports that more truthfully reflect the real amount of test churn, or lack thereof.
Test Results 827 files ± 0 827 suites ±0 3h 44m 31s ⏱️ - 21m 23s Results for commit 2f2afc2. ± Comparison against base commit 2136bb1. This pull request removes 135 and adds 35 tests. Note that renamed tests count towards both. |
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.
Previously several parameterized tests used
Lists of items without customtoStringmethods. Including these in test names led to generated test names likejava17IRTestName=CatchMultipleExceptionTypes, ca=[com.ibm.wala.cast.java.test.ECJJava17IRTest$3@6e576b5a], where the6e576b5apart varied randomly from one run to the next. That nondeterminism, in turn, led to misleading claims of test churn in test reports. For example, this report states that "this pull request removes 118 and adds 118 tests." No tests were actually removed, though: 118 tests simply changed the hex digits in their names.Now we customize the name template for some parameterized tests to omit items with nondeterministic
toStringresults. This change should give us test reports that more truthfully reflect the real amount of test churn, or lack thereof.