-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Strip out seed from reproduce method name #121987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When -Dtests.iters is used the test seed is appended to the method name by randomized runner. That in turn causes the reproduce line to contain the seed as part of the method name, which makes the reproduce line unuseable. This commit strips off any additional part of the method name before printing.
Pinging @elastic/es-delivery (Team:Delivery) |
@@ -61,6 +61,7 @@ public void testReplacePropertiesPlaceholderSystemProperty() { | |||
.replacePropertyPlaceholders() | |||
.build(); | |||
assertThat(settings.get("setting1"), equalTo(value)); | |||
fail("foo"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this part also be merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely not! removed
if (methodName != null) { | ||
// Method names only have spaces if used with -Dtests.iters where the seed is appended. | ||
// Here we strip out anything from the first space, leaving the real method name intact. | ||
methodName = methodName.split(" ")[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the case. For things like YAML tests the names very often have spaces. This would then cause those repro lines to be corrupted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I had not considered parameterized tests. In fact, the seed is put into the same curly-braced section as parameters.
When -Dtests.iters is used the test seed is appended to the method name by randomized runner. That in turn causes the reproduce line to contain the seed as part of the method name, which makes the reproduce line unuseable. This commit strips off any additional part of the method name before printing.