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

bin/plugin tests for missing plugin name when passing --url #6013

Conversation

pickypg
Copy link
Member

@pickypg pickypg commented May 2, 2014

When setting the --url, it now sets the implied action--INSTALL. Therefore, if the user fails to supply the install flag themselves, then the plugin name will be caught as missing (also added to remove incase a future scenario allows that) and fail immediately.

Adding code to test for unset plugin names to fail fast with descriptive error messages (for all flags that require a value). Also simplified the series of if statements checking for the commands by using a switch (now that it's using Java 7), added tests, and updated random exceptions with the up-to-date flag names (e.g., "--verbose" instead of "-verbose").

@dadoonet Note: This will cause or have merge conflicts with #5977. I have no problem with my changes just being incorporated into that PR or doing the merge here.

Also, while messing with the unit tests, I noticed that the package for the tests is org.elasticsearch.plugin while the non-test code is org.elasticsearch.plugins. That's probably worth a cleanup by whoever loses the merge; I avoided doing it upfront to simplify any potential merge.

Closes #5976

…ive error messages. Also simplified the series of `if` statements checking for the commands by using a `switch` (now that it's using Java 7), added tests, and updated random exceptions with the up-to-date flag names (e.g., "--verbose" instead of "-verbose").

Closes elastic#5976
@dadoonet dadoonet self-assigned this May 7, 2014
dadoonet pushed a commit that referenced this pull request Jul 4, 2014
Adding code to test for unset plugin names to fail fast with descriptive error messages. Also simplified the series of `if` statements checking for the commands by using a `switch` (now that it's using Java 7), added tests, and updated random exceptions with the up-to-date flag names (e.g., "--verbose" instead of "-verbose").

Closes #5976.
Closes #6013.

(cherry picked from commit 312eb2b)
@dadoonet dadoonet closed this in 312eb2b Jul 4, 2014
@dadoonet
Copy link
Member

dadoonet commented Jul 4, 2014

Thanks! Pushed in 1.x and master

@dadoonet dadoonet added v1.2.2 and removed v1.2.2 labels Jul 4, 2014
@clintongormley clintongormley changed the title bin/plugin tests for missing plugin name when passing --url Plugins: bin/plugin tests for missing plugin name when passing --url Jul 16, 2014
@pickypg pickypg deleted the feature/plugin-manager-should-fail-loudly-5976 branch August 2, 2014 23:33
@clintongormley clintongormley added the :Core/Infra/Plugins Plugin API and infrastructure label Jun 7, 2015
@clintongormley clintongormley changed the title Plugins: bin/plugin tests for missing plugin name when passing --url bin/plugin tests for missing plugin name when passing --url Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bin/plugin -u url fails silently
3 participants