Skip to content
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-32858][tests][JUnit5 migration] Migrate flink-runtime/utils tests to JUnit5 #23199

Merged
merged 1 commit into from Aug 24, 2023

Conversation

X-czh
Copy link
Contributor

@X-czh X-czh commented Aug 13, 2023

What is the purpose of the change

Migrate flink-runtime/utils tests to JUnit5.

Verifying this change

The change itself is for migrating UT.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 13, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @X-czh , thanks for the contribution.

I didn't finish the review, and just did a quick review. I found a few changes can be improved. These checks can be more specific by their types. Such as:

  • The AbstractIterableAssert has a series of checks method for iterable: isEmpty, hasSize, etc.
    • Change the assertThat(testInstance.size()).isEqualTo(0); to assertThat(testInstance).isEmpty();.
    • Change the assertThat(testInstance.size()).isEqualTo(1); to assertThat(testInstance).hasSize(1);
  • Using the assertThat(pid) instead of assertThat(pid != -1).
    • Change the assertThat(pid != -1).withFailMessage("Cannot determine process ID").isTrue(); to assertThat(pid).withFailMessage("Cannot determine process ID").isNotEqualTo(-1);

Would you mind finding relevant changes first and improving them? thanks~

*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JingGe , I'm not sure should these classes releted to junit4 be marked to Deprecated. Would you mind helping check it? thanks a lot~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @X-czh , could you remove this commit, and squash all commit after address other comments?

Because most of junit4 classes are not marked to Deprecated so far, if you want to do it, it's better to do it in a separate JIRA, and mark all classes togother.

WDYT?

@X-czh
Copy link
Contributor Author

X-czh commented Aug 13, 2023

Thanks for the comments! I've searched through the change list again and improved a few usages in a fixup commit.

@1996fanrui
Copy link
Member

Hi @Jiabao-Sun , would you mind helping review this PR in your free time? thanks~

Copy link
Contributor

@Jiabao-Sun Jiabao-Sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @X-czh for this contribution.
I left some comments.

@X-czh
Copy link
Contributor Author

X-czh commented Aug 17, 2023

Hi @Jiabao-Sun, thanks for your comments, I will address them today,

@X-czh
Copy link
Contributor Author

X-czh commented Aug 17, 2023

Hi @Jiabao-Sun, I've addressed all the comments, take your time to review it again. Thanks~

@Jiabao-Sun
Copy link
Contributor

Hi @Jiabao-Sun, thanks for your comments, I will address them today,

Thanks @X-czh for the quick commits.
I noticed that there's also some changes is not accepted.
Can you help check it?

@X-czh
Copy link
Contributor Author

X-czh commented Aug 18, 2023

Thanks @Jiabao-Sun, I've addressed the missing comments and applied an improvement to assert exception messages with the assertThat(ex).hasMessage(msg) pattern.

Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @X-czh for the contribution and @Jiabao-Sun for the review!

I left some minor comments, please take a look in your free time, thanks~

@X-czh
Copy link
Contributor Author

X-czh commented Aug 18, 2023

Thanks for the review @1996fanrui! I've addressed all the comments. Take your time to review it, thanks~

*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @X-czh , could you remove this commit, and squash all commit after address other comments?

Because most of junit4 classes are not marked to Deprecated so far, if you want to do it, it's better to do it in a separate JIRA, and mark all classes togother.

WDYT?

@X-czh
Copy link
Contributor Author

X-czh commented Aug 24, 2023

Thanks for the comments, I'll remove the deprecation commit and squash all commit after address other comments

Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @X-czh for the hard work, and @Jiabao-Sun for the great review!

LGTM!

@1996fanrui 1996fanrui merged commit 8e5bdd9 into apache:master Aug 24, 2023
@X-czh X-czh deleted the FLINK-32858 branch August 26, 2023 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants