Skip to content

Test cloud based repository plugins using real services backends #29349

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

Closed
3 tasks done
tlrx opened this issue Apr 3, 2018 · 3 comments
Closed
3 tasks done

Test cloud based repository plugins using real services backends #29349

tlrx opened this issue Apr 3, 2018 · 3 comments
Assignees
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Meta >test Issues or PRs that are addressing/adding tests

Comments

@tlrx
Copy link
Member

tlrx commented Apr 3, 2018

Disclaimer: this issue concerns the repository plugins that use cloud-based services like Amazon S3, Azure Storage and Google Cloud Storage in order to store snapshot files.

These plugins used to be tested automatically against the real service they implement but it is not the case anymore. While some developers complained that the integration tests failed too often because of service outage/disconnections, we still think that we must have these automatized tests if we want to catch more bugs and add more features.

We recently added integration tests that use fixtures which emulate service backends (#28788, #29296, #29347). After discussing with @rjernst we could move these tests in QA sub projects under each repository plugin project. We could change the build.gradle files so that the required credentials for each service are pulled out from environment variables. If the env vars are supplied then the REST integration tests are executed against the real service backend. Otherwise the fixtures will be used to execute the tests.

Note: The fs and hdfs plugins are already correctly tested I think. The url could have integration tests but it can be treated as a separate issue. Same for discovery plugins that could benefit from fixture based integration tests and also real integration tests, but I'd like to address those in a separate issue.

Related to #20862

@tlrx tlrx added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Meta labels Apr 3, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@tlrx tlrx self-assigned this Apr 3, 2018
@rjernst
Copy link
Member

rjernst commented Apr 3, 2018

Having the ability to test against the real services sounds great (given sufficient setup information passed into the test). One ask: it would be nice to have the qa/third-party tests work "normally" so we know eg the rest test files work, and "swap out" the fixture for the real service when running the test when credentials/etc are passed in. Your idea to use the rest tests from the plugin itself sound good, but I worry the setup of the test in gradle would be left untested until we actually pass in the credentials. What if the fixture based tests were all under qa/third-party?

@tlrx
Copy link
Member Author

tlrx commented Apr 4, 2018

Thanks @rjernst, that's the feedback I wanted. I updated the description of the issue and moving REST tests and fixtures under qa/third-party sounds like a good idea.

tlrx added a commit to tlrx/elasticsearch that referenced this issue Apr 27, 2018
This commit moves the repository-s3 fixture test added in elastic#29296 in a
new `qa/third-party/amazon-s3` project. This new project allows the
REST integration tests to be executed using the real S3 service when
all the required environment variables are provided. When no env var
is provided, then the tests are executed using the fixture added
in elastic#29296.

The REST tests located in the plugin project now only verify that the
plugin is correctly loaded.

The REST tests have been adapted to allow a bucket name and a base path
to be specified as env vars. This way it is possible to run the tests
with different base paths (could be anything, like a CI job name or a
branch name) without multiplicating buckets.

Related to elastic#29349
tlrx added a commit that referenced this issue Apr 27, 2018
This commit moves the repository-s3 fixture test added in #29296 in a
new `repository-s3/qa/amazon-s3` project. This new project allows the
REST integration tests to be executed using the real S3 service when
all the required environment variables are provided. When no env var
is provided, then the tests are executed using the fixture added
in #29296.

The REST tests located at the `repository-s3`plugin  project now only 
verify that the plugin is correctly loaded.

The REST tests have been adapted to allow a bucket name and a base 
path to be specified as env vars. This way it is possible to run the tests
with different base paths (could be anything, like a CI job name or a
branch name) without multiplicating buckets.

Related to #29349
tlrx added a commit that referenced this issue Apr 27, 2018
This commit moves the repository-s3 fixture test added in #29296 in a
new `repository-s3/qa/amazon-s3` project. This new project allows the
REST integration tests to be executed using the real S3 service when
all the required environment variables are provided. When no env var
is provided, then the tests are executed using the fixture added
in #29296.

The REST tests located at the `repository-s3`plugin  project now only
verify that the plugin is correctly loaded.

The REST tests have been adapted to allow a bucket name and a base
path to be specified as env vars. This way it is possible to run the tests
with different base paths (could be anything, like a CI job name or a
branch name) without multiplicating buckets.

Related to #29349
tlrx added a commit to tlrx/elasticsearch that referenced this issue Apr 30, 2018
Similarly to what has been done in for the repository-s3 plugin, this
pull request moves the fixture test into a dedicated
repository-azure/qa/microsoft-azure-storage project.

It also exposes some environment variables which allows to execute the
integration tests against the real Azure Storage service. When the
environment variables are not defined, the integration tests are
executed using the fixture added in elastic#29347.

Related to elastic#29349
tlrx added a commit that referenced this issue Apr 30, 2018
Similarly to what has been done in for the repository-s3 plugin, 
this commit moves the fixture test into a dedicated 
repository-gcs/qa/google-cloud-storage project.

It also exposes some environment variables which allows to 
execute the integration tests against the real Google Cloud 
Storage service. When the environment variables are not 
defined, the integration tests are executed using the fixture 
added in #28788. Related to #29349.
tlrx added a commit that referenced this issue Apr 30, 2018
Similarly to what has been done in for the repository-s3 plugin,
this commit moves the fixture test into a dedicated
repository-gcs/qa/google-cloud-storage project.

It also exposes some environment variables which allows to
execute the integration tests against the real Google Cloud
Storage service. When the environment variables are not
defined, the integration tests are executed using the fixture
added in #28788. Related to #29349.
@tlrx tlrx closed this as completed in 0aad5fd May 2, 2018
tlrx added a commit that referenced this issue May 2, 2018
Similarly to what has been done in for the repository-s3 plugin, this
pull request moves the fixture test into a dedicated
repository-azure/qa/microsoft-azure-storage project.

It also exposes some environment variables which allows to execute the
integration tests against the real Azure Storage service. When the
environment variables are not defined, the integration tests are
executed using the fixture added in #29347.

Closes #29349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Meta >test Issues or PRs that are addressing/adding tests
Projects
None yet
Development

No branches or pull requests

3 participants