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

Test command line tools with custom paths #12712

Closed
clintongormley opened this issue Aug 7, 2015 · 10 comments
Closed

Test command line tools with custom paths #12712

clintongormley opened this issue Aug 7, 2015 · 10 comments
Assignees
Labels
blocker >test Issues or PRs that are addressing/adding tests v2.0.0

Comments

@clintongormley
Copy link
Contributor

Test commandline tools with custom paths in qa/

  • Especially stuff like custom plugin path
@clintongormley clintongormley added >test Issues or PRs that are addressing/adding tests blocker v2.0.0 labels Aug 7, 2015
@colings86
Copy link
Contributor

I ran the following as a manual test to test the beta and also to start recording tests that we might want to have for this when we write an automated test to cover it. The test was run on a 2.0.0-beta1-snapshot build with no configuration changes at all (literally unzip and run).

Installing a plugin to a custom path

ran:

bin/plugin -Des.path.plugins=/path/to/custom/plugins install scirpt-python -u file:/path/to/elasticsearch-master/plugins/lang-python/target/releases/elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.zip

output on command line was:

-> Installing scirpt-python...
Trying file:/path/to/elasticsearch-master/plugins/lang-python/target/releases/elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.zip ...
Downloading ............................................................................................................................................................................................................................................................................................................................................DONE
PluginInfo{name='scirpt-python', description='The Python language plugin allows to have python as the language of scripts to execute.', site=false, jvm=true, classname=org.elasticsearch.plugin.python.PythonPlugin, isolated=true, version='2.0.0-beta1-SNAPSHOT'}
Installed scirpt-python into /path/to/custom/plugins/scirpt-python

ls /path/to/custom/plugins/scirpt-python gives:

elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.jar jython-standalone-2.7.0.jar plugin-descriptor.properties

SUCCESSFUL

@clintongormley
Copy link
Contributor Author

@colings86 probably need to test custom logs/config/scripts/repo paths as well

@colings86
Copy link
Contributor

yup, getting to that now. Posting one test at a time ;)

@colings86
Copy link
Contributor

Listing plugins in a custom directory

Ran:

bin/plugin -Des.path.plugins=/path/to/custom/plugins list

output:

Installed plugins in /path/to/custom/plugins:
    - scirpt-python

SUCCESSFUL

Removing a plugin using a custom plugins path

ran:

bin/plugin -Des.path.plugins=/path/to/custom/plugins remove scirpt-python

output:

-> Removing scirpt-python...
Removed scirpt-python

/path/to/custom/plugins directory no longer contained scirpt-python directory

SUCCESSFUL

@colings86
Copy link
Contributor

bin/plugin with custom config directory

For this test I created a conf directory at /path/to/custom/config and copied the default elasticsearch.yml file changing it only to add path.plugins: /path/to/custom/plugins

Installing a plugin

ran:

bin/plugin -Des.path.conf=/path/to/custom/config install script-python -u file:/path/to/elasticsearch-master/plugins/lang-python/target/releases/elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.zip

output:

-> Installing script-python...
Trying file:/path/to/elasticsearch-master/plugins/lang-python/target/releases/elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.zip ...
Downloading ............................................................................................................................................................................................................................................................................................................................................DONE
PluginInfo{name='script-python', description='The Python language plugin allows to have python as the language of scripts to execute.', site=false, jvm=true, classname=org.elasticsearch.plugin.python.PythonPlugin, isolated=true, version='2.0.0-beta1-SNAPSHOT'}
log4j:WARN No appenders could be found for logger (org.elasticsearch.bootstrap).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Installed script-python into /path/to/custom/plugins/script-python

Confirmed script-python directory added to /path/to/custom/plugins

SUCCESSFUL

Listing plugins

ran:

bin/plugin -Des.path.conf=/path/to/custom/config list

output:

Installed plugins in /path/to/custom/plugins:
    - script-python

SUCCESSFUL

Remove plugins

ran:

bin/plugin -Des.path.conf=/path/to/custom/config remove script-python

output:

-> Removing script-python...
Removed script-python

Confirmed script-python directory removed from /path/to/custom/plugins

SUCCESSFUL

@colings86
Copy link
Contributor

bin/plugin with custom log directory

Installing a plugin

ran:

bin/plugin -Des.path.logs=/path/to/custom/logs install script-python -u file:/path/to/elasticsearch-master/plugins/lang-python/target/releases/elasticsearch-lang-python-2.0.0-beta1-SNAPSHOT.zip

Confirmed script-python directory added to /path/to/custom/plugins and /path/to/custom/logs directory created with the following files:

elasticsearch.log                        elasticsearch_deprecation.log            elasticsearch_index_indexing_slowlog.log elasticsearch_index_search_slowlog.log

Also confirmed default logs directory was not created.

SUCCESSFUL

Listing plugins

ran:

bin/plugin -Des.path.logs=/path/to/custom/logs list

output:

Installed plugins in /path/to/custom/plugins:
    - script-python

Confirmed /path/to/custom/logs directory created with the following files:

elasticsearch.log                        elasticsearch_deprecation.log            elasticsearch_index_indexing_slowlog.log elasticsearch_index_search_slowlog.log

Also confirmed default logs directory was not created.

SUCCESSFUL

Remove plugins

ran:

bin/plugin -Des.path.logs=/path/to/custom/logs remove script-python

output:

-> Removing script-python...
Removed script-python

Confirmed script-python directory removed from /path/to/custom/plugins and /path/to/custom/logs directory created with the following files:

elasticsearch.log                        elasticsearch_deprecation.log            elasticsearch_index_indexing_slowlog.log elasticsearch_index_search_slowlog.log

Also confirmed default logs directory was not created.

SUCCESSFUL

@spinscale
Copy link
Contributor

how exactly should this be implemented for automated tests? Would we have another project in qa/ that installs/removes plugins with custom paths using custom ./integration-tests.xml files?

Or do we have more <ant antfile calls in the pom.xml of the smoke-test-plugins that just installs plugins into different paths?

@brwe
Copy link
Contributor

brwe commented Aug 18, 2015

I made a pr with the first option (another project in qa/ that installs/removes plugins with custom paths) here: #12954.
I wonder if a bats test for this would be better though. Maybe @nik9000 has an opinion on this?

@nik9000
Copy link
Member

nik9000 commented Sep 9, 2015

I wonder if a bats test for this would be better though. Maybe @nik9000 has an opinion on this?

Sorry I hadn't noticed this! Right now the bats tests are used to test bin/plugin and bin/elasticsearch with a few custom paths already so its not a huge stretch, especially when many path errors come from space escaping issues with bash. So its a reasonable choice.

brwe added a commit to brwe/elasticsearch that referenced this issue Sep 15, 2015
This one test for each these options

-Des.path.plugins
-Des.path.conf
-Des.path.logs

Each of the new tests installs each plugin with the option and tests if
elasticsearch is able to start with all plugins
In addition, this adds checks that

- plugins can be uninstalled
- config path is actually used
- log path is actually used
- plugins can be listed with 'plugins list'

closes elastic#12712
brwe added a commit to brwe/elasticsearch that referenced this issue Sep 21, 2015
When running bin/elasticsearch config dir and config file can be passed as a parameter
independently with -Des.config and -Des.path.conf. If the config file is not provided
then it is assumed to be {path.conf}/elasticearch.yml

This was not so for running as a service. For deb the CONF_FILE still pointed
to the default path even if a custom CONF_DIR was defined.
For rpm the CONF_FILE parameter was not passed on at all, see elastic#5329 .

Custom config path and config file now work as follows for all services except systemd:

CONF_DIR and CONF_FILE undefined: CONF_FILE points to default
CONF_DIR defined but CONF_FILE undefined: CONF_FILE points to CONF_DIR/elasticsearch.yml
CONF_FILE defined: CONF_FILE must point to an absolute path

For systemd this commit only fixes that the service could be started if only a CONF_DIR
is defined. However, now a custom CONF_FILE cannot be defined anymore which seemed
the lesser evil to me.

relates to elastic#12712 and elastic#12954
closes elastic#5329
@brwe brwe removed the help wanted adoptme label Oct 5, 2015
brwe added a commit to brwe/elasticsearch that referenced this issue Oct 6, 2015
…efault.conf

It is rarely used and was not consistently handled by different distributions anyway.
This commit also adds a test for specifying CONF_DIR when installing plugins and
starting elasticsearch.

relates to elastic#12712 and elastic#12954
closes elastic#5329
closes elastic#13715
@brwe
Copy link
Contributor

brwe commented Oct 7, 2015

This has been implemented as bats test now #12717, in #13258 , #13772 , #13617 and #13640

@brwe brwe closed this as completed Oct 7, 2015
brwe added a commit that referenced this issue Oct 7, 2015
…efault.conf

It is rarely used and was not consistently handled by different distributions anyway.
This commit also adds a test for specifying CONF_DIR when installing plugins and
starting elasticsearch.

relates to #12712 and #12954
closes #5329
closes #13715

Merge pull request #13772 from brwe/remove-CONF_FILE
brwe added a commit that referenced this issue Oct 7, 2015
…efault.conf

It is rarely used and was not consistently handled by different distributions anyway.
This commit also adds a test for specifying CONF_DIR when installing plugins and
starting elasticsearch.

relates to #12712 and #12954
closes #5329
closes #13715

Merge pull request #13772 from brwe/remove-CONF_FILE
brwe added a commit that referenced this issue Oct 7, 2015
…efault.conf

It is rarely used and was not consistently handled by different distributions anyway.
This commit also adds a test for specifying CONF_DIR when installing plugins and
starting elasticsearch.

relates to #12712 and #12954
closes #5329
closes #13715

Merge pull request #13772 from brwe/remove-CONF_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker >test Issues or PRs that are addressing/adding tests v2.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants