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
[FLINK-32837][JUnit5 Migration] Migrate the client and clusterframework packages of flink-runtime module to junit5 #23241
[FLINK-32837][JUnit5 Migration] Migrate the client and clusterframework packages of flink-runtime module to junit5 #23241
Conversation
…rk packages of flink-runtime module to junit5
7225095
to
08fe96c
Compare
cc @Jiabao-Sun |
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.
Thanks @1996fanrui for this great work.
I left some comments for improvements.
|
||
/** Tests for {@link JobManagerProcessUtils}. */ | ||
public class JobManagerProcessUtilsTest extends ProcessMemoryUtilsTestBase<JobManagerProcessSpec> { | ||
class JobManagerProcessUtilsTest extends ProcessMemoryUtilsTestBase<JobManagerProcessSpec> { |
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.
This test class seems in module jobmanager.
Is there any dependence?
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.
Yeah the class in jobmanager module.
I migrated it because JobManagerProcessUtilsTest
and TaskExecutorProcessUtilsTest
extends ProcessMemoryUtilsTestBase
.
I want to migrate these 3 classes to junit5 together, however ProcessMemoryUtilsTestBase
is migrated at #23199, so I updated JobManagerProcessUtilsTest
and TaskExecutorProcessUtilsTest
at this PR.
Do you think it is ok?
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.
It's ok to me.
assertThat(res).hasSize(1); | ||
Map.Entry<String, String> entry = res.entrySet().iterator().next(); | ||
Assert.assertEquals("LD_LIBRARY_PATH", entry.getKey()); | ||
Assert.assertEquals("/usr/lib/native", entry.getValue()); | ||
assertThat(entry.getKey()).isEqualTo("LD_LIBRARY_PATH"); | ||
assertThat(entry.getValue()).isEqualTo("/usr/lib/native"); |
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 it can be simplified as
assertThat(res).hasSize(1).containsEntry("LD_LIBRARY_PATH", "/usr/lib/native")
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.
Good suggestion, it's very concise! updated
assertThat(flinkConfig.get(listStringConfigOption)) | ||
.containsAnyOf(list.toArray(new String[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.
assertThat(flinkConfig.get(listStringConfigOption)) | |
.containsAnyOf(list.toArray(new String[0])); | |
assertThat(flinkConfig.get(listStringConfigOption)) | |
.containsExactlyInAnyOrderElementsOf(list); |
assertThat(flinkConfig.get(listDurationConfigOption)) | ||
.containsAnyOf(durationList.toArray(new Duration[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.
assertThat(flinkConfig.get(listDurationConfigOption)) | |
.containsAnyOf(durationList.toArray(new Duration[0])); | |
assertThat(flinkConfig.get(listDurationConfigOption)) | |
.containsExactlyInAnyOrderElementsOf(durationList); |
assertThat(loadedFlinkConfig.get(listStringConfigOption)) | ||
.contains(list.toArray((new String[0]))); | ||
assertThat(loadedFlinkConfig.get(listDurationConfigOption)) | ||
.contains(durationList.toArray((new Duration[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.
assertThat(loadedFlinkConfig.get(listStringConfigOption)) | |
.contains(list.toArray((new String[0]))); | |
assertThat(loadedFlinkConfig.get(listDurationConfigOption)) | |
.contains(durationList.toArray((new Duration[0]))); | |
assertThat(loadedFlinkConfig.get(listStringConfigOption)) | |
.containsExactlyInAnyOrderElementsOf(list); | |
assertThat(loadedFlinkConfig.get(listDurationConfigOption)) | |
.containsExactlyInAnyOrderElementsOf(durationList); |
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.
Thanks @Jiabao-Sun 's review, I have updated all comments, please help check them in your free time, thanks~
assertThat(res).hasSize(1); | ||
Map.Entry<String, String> entry = res.entrySet().iterator().next(); | ||
Assert.assertEquals("LD_LIBRARY_PATH", entry.getKey()); | ||
Assert.assertEquals("/usr/lib/native", entry.getValue()); | ||
assertThat(entry.getKey()).isEqualTo("LD_LIBRARY_PATH"); | ||
assertThat(entry.getValue()).isEqualTo("/usr/lib/native"); |
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.
Good suggestion, it's very concise! updated
|
||
/** Tests for {@link JobManagerProcessUtils}. */ | ||
public class JobManagerProcessUtilsTest extends ProcessMemoryUtilsTestBase<JobManagerProcessSpec> { | ||
class JobManagerProcessUtilsTest extends ProcessMemoryUtilsTestBase<JobManagerProcessSpec> { |
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.
Yeah the class in jobmanager module.
I migrated it because JobManagerProcessUtilsTest
and TaskExecutorProcessUtilsTest
extends ProcessMemoryUtilsTestBase
.
I want to migrate these 3 classes to junit5 together, however ProcessMemoryUtilsTestBase
is migrated at #23199, so I updated JobManagerProcessUtilsTest
and TaskExecutorProcessUtilsTest
at this PR.
Do you think it is ok?
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.
Thanks @1996fanrui for the quick update.
LGTM.
…rk packages of flink-runtime module to junit5 (apache#23241)
[FLINK-32837][JUnit5 Migration] Migrate the client and clusterframework packages of flink-runtime module to junit5