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

Add docker-composed based test fixture for GCS #48762

Merged
merged 2 commits into from
Nov 7, 2019

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Oct 31, 2019

Similarly to what has be done for Azure in #48636, this pull request adds a new :test:fixtures:gcs-fixture project which provides two docker-compose based fixture that emulates a Google Cloud Storage service.

Some code has been extracted from existing tests and placed into this new project so that it can be easily reused in other projects.

@tlrx tlrx added >test Issues or PRs that are addressing/adding tests :Delivery/Build Build or test infrastructure :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.5.0 v7.6.0 labels Oct 31, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@elasticmachine
Copy link
Collaborator

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

@@ -86,6 +86,19 @@ task createServiceAccountFile() {
}

task thirdPartyTest (type: Test) {
if (useFixture) {
thirdPartyTest.dependsOn createServiceAccountFile
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm wondering if dependsOn tasks.postProcessFixture is also needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope. The test fixtures plugin automatically makes all Test tasks depend on the fixture tasks. Essentially, when a project "uses a fixture" it's assumed that all tests require that fixture.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, thanks @mark-vieira !

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Keep 'em coming.

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM2 thanks Tanguy!

@tlrx tlrx force-pushed the docker-compose-fixture-for-gcs branch from b25eff1 to 65bc9e5 Compare November 5, 2019 14:19
@tlrx
Copy link
Member Author

tlrx commented Nov 6, 2019

@elasticmachine run elasticsearch-ci/packaging-sample-matrix

(unrelated checkout failure)

@tlrx tlrx merged commit 625c00d into elastic:master Nov 7, 2019
@tlrx tlrx deleted the docker-compose-fixture-for-gcs branch November 7, 2019 16:17
@tlrx
Copy link
Member Author

tlrx commented Nov 7, 2019

Thanks all for your reviews!

tlrx added a commit to tlrx/elasticsearch that referenced this pull request Nov 7, 2019
Similarly to what has be done for Azure in elastic#48636, this commit
adds a new :test:fixtures:gcs-fixture project which provides two
docker-compose based fixtures that emulate a Google Cloud
Storage service.

Some code has been extracted from existing tests and placed
into this new project so that it can be easily reused in other
projects.
tlrx added a commit that referenced this pull request Nov 18, 2019
Similarly to what has been done for Azure (#48636) and GCS (#48762), 
this committ removes the existing Ant fixture that emulates a S3 storage 
service in favor of multiple docker-compose based fixtures.

The goals here are multiple: be able to reuse a s3-fixture outside of the 
repository-s3 plugin; allow parallel execution of integration tests; removes 
the existing AmazonS3Fixture that has evolved in a weird beast in 
dedicated, more maintainable fixtures.

The server side logic that emulates S3 mostly comes from the latest 
HttpHandler made for S3 blob store repository tests, with additional 
features extracted from the (now removed) AmazonS3Fixture: 
authentication checks, session token checks and improved response 
errors. Chunked upload request support for S3 object has been added 
too. 

The server side logic of all tests now reside in a single S3HttpHandler class.

Whereas AmazonS3Fixture contained logic for basic tests, session token 
tests, EC2 tests or ECS tests, the S3 fixtures are now dedicated to each 
kind of test. Fixtures are inheriting from each other, making things easier 
to maintain.
tlrx added a commit to tlrx/elasticsearch that referenced this pull request Nov 18, 2019
Similarly to what has been done for Azure (elastic#48636) and GCS (elastic#48762),
this committ removes the existing Ant fixture that emulates a S3 storage
service in favor of multiple docker-compose based fixtures.

The goals here are multiple: be able to reuse a s3-fixture outside of the
repository-s3 plugin; allow parallel execution of integration tests; removes
the existing AmazonS3Fixture that has evolved in a weird beast in
dedicated, more maintainable fixtures.

The server side logic that emulates S3 mostly comes from the latest
HttpHandler made for S3 blob store repository tests, with additional
features extracted from the (now removed) AmazonS3Fixture:
authentication checks, session token checks and improved response
errors. Chunked upload request support for S3 object has been added
too.

The server side logic of all tests now reside in a single S3HttpHandler class.

Whereas AmazonS3Fixture contained logic for basic tests, session token
tests, EC2 tests or ECS tests, the S3 fixtures are now dedicated to each
kind of test. Fixtures are inheriting from each other, making things easier
to maintain.
tlrx added a commit that referenced this pull request Nov 18, 2019
Similarly to what has been done for Azure (#48636) and GCS (#48762),
this committ removes the existing Ant fixture that emulates a S3 storage
service in favor of multiple docker-compose based fixtures.

The goals here are multiple: be able to reuse a s3-fixture outside of the
repository-s3 plugin; allow parallel execution of integration tests; removes
the existing AmazonS3Fixture that has evolved in a weird beast in
dedicated, more maintainable fixtures.

The server side logic that emulates S3 mostly comes from the latest
HttpHandler made for S3 blob store repository tests, with additional
features extracted from the (now removed) AmazonS3Fixture:
authentication checks, session token checks and improved response
errors. Chunked upload request support for S3 object has been added
too.

The server side logic of all tests now reside in a single S3HttpHandler class.

Whereas AmazonS3Fixture contained logic for basic tests, session token
tests, EC2 tests or ECS tests, the S3 fixtures are now dedicated to each
kind of test. Fixtures are inheriting from each other, making things easier
to maintain.
tlrx added a commit that referenced this pull request Nov 18, 2019
Similarly to what has been done for Azure (#48636) and GCS (#48762),
this committ removes the existing Ant fixture that emulates a S3 storage
service in favor of multiple docker-compose based fixtures.

The goals here are multiple: be able to reuse a s3-fixture outside of the
repository-s3 plugin; allow parallel execution of integration tests; removes
the existing AmazonS3Fixture that has evolved in a weird beast in
dedicated, more maintainable fixtures.

The server side logic that emulates S3 mostly comes from the latest
HttpHandler made for S3 blob store repository tests, with additional
features extracted from the (now removed) AmazonS3Fixture:
authentication checks, session token checks and improved response
errors. Chunked upload request support for S3 object has been added
too.

The server side logic of all tests now reside in a single S3HttpHandler class.

Whereas AmazonS3Fixture contained logic for basic tests, session token
tests, EC2 tests or ECS tests, the S3 fixtures are now dedicated to each
kind of test. Fixtures are inheriting from each other, making things easier
to maintain.
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests v7.5.0 v7.6.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants