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

[Storage][Test] Test multiple service versions #19039

Merged
merged 10 commits into from
Jun 9, 2021
Merged

Conversation

seankane-msft
Copy link
Member

No description provided.

Copy link
Contributor

@kasobol-msft kasobol-msft left a comment

Choose a reason for hiding this comment

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

LGTM.
Could you pick 1 or 2 tests in each storage package and make them use this? So that folks have reference to look at how to use it as well as prove that this is working as expected?

return kwargs.pop("service_version", env_version)

def create_storage_client(self, client, *args, **kwargs):
kwargs["api_version"] = self._get_service_version(**kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

in nightly pipeline we'd like clients to pick the default, i.e. env variable is empty.
does this code achieve this by leaving "api_version" kwarg empty or we need some "if" 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.

If the environment variable is empty, it will default to LATEST_SERVICE_VERSION

sdk/storage/platform-matrix.json Outdated Show resolved Hide resolved
@tasherif-msft
Copy link
Contributor

A working example would def be great here

sdk/storage/tests.yml Outdated Show resolved Hide resolved
self.api_version = api_version

def on_request(self, request):
assert request.http_request.headers['x-ms-version'] == self.api_version
Copy link
Contributor

Choose a reason for hiding this comment

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

will this throw if env variable is empty? , we should either handle it here or not inject policy if there's no service version provided extrenally.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, if the env variable is empty it will default to LATEST_SERVICE_VERSION

Comment on lines 316 to 318
def _get_service_version(self, **kwargs):
env_version = os.environ.get("AZURE_LIVE_TEST_SERVICE_VERSION", LATEST_SERVICE_VERSION)
return kwargs.pop("service_version", env_version)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to not copy code between storage modules? "storage test shared" module would be great.
We have one in .NET, we started one in Java while doing similar changes. Maybe we could use this opportunity to start one in python?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can probably put this in devtools_testutils, I'm working on an improvement PR for this that includes code we have shared in tables and storage here

Copy link
Contributor

Choose a reason for hiding this comment

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

That'd be great. not a blocker here, but we should do something about all these clones in long term.

Copy link
Member Author

Choose a reason for hiding this comment

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

After merging this, I can make changes for that

@seankane-msft seankane-msft requested a review from benbp June 4, 2021 22:16
benbp
benbp previously requested changes Jun 4, 2021
sdk/storage/tests.yml Outdated Show resolved Hide resolved
@seankane-msft
Copy link
Member Author

Need to add a decorator to wrap tests for specific service versions

@check-enforcer
Copy link

check-enforcer bot commented Jun 8, 2021

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run python - [service] - ci

@seankane-msft seankane-msft dismissed benbp’s stale review June 9, 2021 18:27

comments addresses

@seankane-msft seankane-msft merged commit e7cf320 into master Jun 9, 2021
@seankane-msft seankane-msft deleted the storage-svtest branch June 9, 2021 18:27
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this pull request May 12, 2022
[Go]Keyvault add batch tag: package-2021-10 (Azure#19039)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants