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

Reduce boilerplate in plugins utils tests #88593

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jul 18, 2022

Tests for PluginsUtils need to create many different plugin descriptors.
But the vast majority of these just need a plugin name and dependencies.
This commit adds a utility method to simplify these tests.

Tests for PluginsUtils need to create many different plugin descriptors.
But the vast majority of these just need a plugin name and dependencies.
This commit adds a utility method to simplify these tests.
@rjernst rjernst added >test Issues or PRs that are addressing/adding tests :Core/Infra/Plugins Plugin API and infrastructure v8.4.0 labels Jul 18, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jul 18, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -38,6 +37,21 @@
@LuceneTestCase.SuppressFileSystems(value = "ExtrasFS")
public class PluginsUtilsTests extends ESTestCase {

PluginDescriptor newTestDescriptor(String name, List<String> deps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make deps variadic to avoid list creation by caller?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have to create a List for the descriptor regardless.

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

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

lgtm, minor suggestion.

@rjernst rjernst added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jul 18, 2022
@elasticsearchmachine elasticsearchmachine merged commit 26da2e7 into elastic:master Jul 18, 2022
@rjernst rjernst deleted the plugins/test_descriptor branch July 18, 2022 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants