-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 ACR delete tag methods #19680
Add ACR delete tag methods #19680
Conversation
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
// Assert | ||
|
||
// The delete takes some time, so if we call GetTagProperties() without a delay, we get a 200 response. | ||
await Task.Delay(5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Search and Key Vault, we have our own DelayAsync
that effectively goes something like this:
protected async ValueTask DelayAsync(TimeSpan? duration = null)
{
duration ??= TimeSpan.FromSeconds(5);
if (TestMode == RecordingTestMode.Playback)
{
return ValueTask.Completed;
}
else
{
await Task.Delay(duration);
}
}
This way, you don't waste time during playback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, Heath, thanks for the pointer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add this to https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core.TestFramework/src/TestRecording.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, take a look at Search or Key Vault's. It's a bit more robust (involved) than this sample, but this shows the gist of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...effectively, you can optionally set a delay, or for retries (something else maybe to add, but separate) a polling interval with default. Both should probably take a CancellationToken
, not that we use them much (but occasionally).
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
...ntainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryTestEnvironment.cs
Show resolved
Hide resolved
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
Hello @annelo-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
azp run net - core - ci |
...ainerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs
Show resolved
Hide resolved
@@ -5,6 +5,7 @@ | |||
using System.Collections.Specialized; | |||
using System.Threading; | |||
using System.Web; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm does the "azp" command not work for container registry, "/azp run net - containerregistry - ci"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need a slash '/azp run net - core - ci'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
/azp run net - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
- Add delete tag methods to ContainerRepositoryClient - Use Track 1 mgmt plane ACR client library to import images for delete tests - Refactor client tests so that tests setting read/write attributes to false are marked NonParallelizable Addresses tag delete in Azure#19547
Addresses tag delete in #19547