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

Use fixture to test repository-azure plugin #29347

Merged
merged 2 commits into from
Apr 6, 2018

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Apr 3, 2018

This commit adds a new fixture that emulates an Azure Storage service in order to improve the existing integration tests. This is very similar to what has been made for Google Cloud Storage in #28788 and for Amazon S3 in #29296, and it would have helped a lot to catch bugs like #22534.

It also adds more unit tests in a new AzureBlobStoreTests class.

@tlrx tlrx added review :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v7.0.0 labels Apr 3, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@tlrx tlrx added the >test Issues or PRs that are addressing/adding tests label Apr 3, 2018
Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I have one ask (can be done as a follow-up). LGTM

return Paths.get(dir);
}

private static void writeFile(final Path dir, final String fileName, final String content) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we share the code between this and the other fixtures? Maybe something to put into test:framework? There's lots of code duplication here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I also thought about that. The fixtures will ve moved to a qa/third-party project in upcoming pull requests, so maybe the common code could be located there too.

}

/**
* Retrieves the object name from all derives paths named {pathX} where 0 <= X < 10.
Copy link
Contributor

Choose a reason for hiding this comment

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

derives -> derived

tlrx added 2 commits April 6, 2018 09:14
This commit adds a new fixture that emulates an
Azure Storage service in order to improve the
existing integration tests. This is very similar
to what has been made for Google Cloud Storage
in elastic#28788 and for Amazon S3 in elastic#29296, and it
would have helped a lot to catch bugs like elastic#22534.
@tlrx tlrx force-pushed the add-fixture-for-repository-azure branch from 548bbda to 97cb6b8 Compare April 6, 2018 07:15
@tlrx tlrx merged commit 26fc8ad into elastic:master Apr 6, 2018
@tlrx
Copy link
Member Author

tlrx commented Apr 6, 2018

Thanks @ywelsch !

@tlrx tlrx deleted the add-fixture-for-repository-azure branch April 6, 2018 09:06
tlrx added a commit to tlrx/elasticsearch that referenced this pull request 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 pull request 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
tlrx added a commit that referenced this pull request 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
@tlrx tlrx added the v6.4.0 label Jun 7, 2018
@tlrx
Copy link
Member Author

tlrx commented Jun 7, 2018

This change was backported to 6.x together with #30253

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

Successfully merging this pull request may close these issues.

4 participants