-
Notifications
You must be signed in to change notification settings - Fork 34
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
Set JDK 17 as a default JDK for representation tests #559
base: develop
Are you sure you want to change the base?
Conversation
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/util/TestUtils.kt
Outdated
Show resolved
Hide resolved
@@ -55,53 +54,88 @@ private fun compareAndOverwrite(expectedOutputFilePrefix: String, actualOutput: | |||
check(!expectedOutputFilePrefix.contains(".txt")) { | |||
"Filename $expectedOutputFilePrefix should not contain a file extension (.txt)" | |||
} | |||
// Always overwrite jdk8 non-trace | |||
if (testJdkVersion == TestJdkVersion.JDK_8 && !isInTraceDebuggerMode && OVERWRITE_REPRESENTATION_TESTS_OUTPUT) { | |||
getExpectedLogFileFromSources(getFileNameFor(expectedOutputFilePrefix, TestJdkVersion.JDK_8, false)).writeText(actualOutput) |
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.
When running the test on the default jdk, it would be nice if it created a file if it was not found. Might be cleaner to do that in getExpectedLogFile
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.
Oh, sorry, I did not realize it was for this purpose.
I restored this behavior.
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.
Maybe also throw when there exists no file AND (we are not in JDK17 OR in trace mode). To encourage first running and creating the default.
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.
Let's allow creating the file automatically if the OVERWRITE_REPRESENTATION_TESTS_OUTPUT
flag is passed.
It is easier this way to create the file on the first run.
A developer can then look at generated file or diff to verify it.
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.
Oh, sorry, I see your point now.
If there is no "default" file, it will always create the jdk-specific file. Ok, I'll fix that.
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/util/TestUtils.kt
Outdated
Show resolved
Hide resolved
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/util/TestUtils.kt
Outdated
Show resolved
Hide resolved
As a part of this PR, I also disabled spin-loop representation tests in trace debugger mode. |
), | ||
|
||
// next, try to pick the jdk-specific file | ||
TestFileConfiguration( |
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.
Suggestion: this can also be wrapped in if (isInTraceDebuggerMode)
and the bottom two in if (testJdkVersion != DEFAULT_TEST_JDK_VERSION)
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'll keep it as is. The logic is already complicated enough, I would prefer to keep the number of if
-s minimal.
@@ -55,53 +54,88 @@ private fun compareAndOverwrite(expectedOutputFilePrefix: String, actualOutput: | |||
check(!expectedOutputFilePrefix.contains(".txt")) { | |||
"Filename $expectedOutputFilePrefix should not contain a file extension (.txt)" | |||
} | |||
// Always overwrite jdk8 non-trace | |||
if (testJdkVersion == TestJdkVersion.JDK_8 && !isInTraceDebuggerMode && OVERWRITE_REPRESENTATION_TESTS_OUTPUT) { | |||
getExpectedLogFileFromSources(getFileNameFor(expectedOutputFilePrefix, TestJdkVersion.JDK_8, false)).writeText(actualOutput) |
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.
Maybe also throw when there exists no file AND (we are not in JDK17 OR in trace mode). To encourage first running and creating the default.
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
a7190fa
to
9164fb3
Compare
No description provided.