1
0
mirror of https://github.com/docker/compose.git synced 2025-04-08 17:05:13 +02:00

In ACI e2e tests, do not wait for full resource group deletion at the end, let ACI clean things UP (timeframe ~45 sec). This is costing GH Action minutes for nothing, and slows test results.

This commit is contained in:
Guillaume Tardif 2020-07-02 16:04:12 +02:00
parent 42b516e738
commit a9ef20eefd
3 changed files with 7 additions and 10 deletions

@ -221,7 +221,7 @@ func (s *MockResourceGroupHelper) CreateOrUpdate(ctx context.Context, subscripti
return args.Get(0).(resources.Group), args.Error(1)
}
func (s *MockResourceGroupHelper) Delete(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
func (s *MockResourceGroupHelper) DeleteAsync(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
args := s.Called(ctx, subscriptionID, resourceGroupName)
return args.Error(0)
}

@ -32,7 +32,7 @@ type ACIResourceGroupHelper interface {
ListGroups(ctx context.Context, subscriptionID string) ([]resources.Group, error)
GetGroup(ctx context.Context, subscriptionID string, groupName string) (resources.Group, error)
CreateOrUpdate(ctx context.Context, subscriptionID string, resourceGroupName string, parameters resources.Group) (result resources.Group, err error)
Delete(ctx context.Context, subscriptionID string, resourceGroupName string) error
DeleteAsync(ctx context.Context, subscriptionID string, resourceGroupName string) error
}
type aciResourceGroupHelperImpl struct {
@ -87,18 +87,15 @@ func (mgt aciResourceGroupHelperImpl) CreateOrUpdate(ctx context.Context, subscr
return gc.CreateOrUpdate(ctx, resourceGroupName, parameters)
}
// Delete deletes a resource group
func (mgt aciResourceGroupHelperImpl) Delete(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
// DeleteAsync deletes a resource group. Does not wait for full deletion to return (long operation)
func (mgt aciResourceGroupHelperImpl) DeleteAsync(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
gc, err := getGroupsClient(subscriptionID)
if err != nil {
return err
}
future, err := gc.Delete(ctx, resourceGroupName)
if err != nil {
return err
}
return future.WaitForCompletionRef(ctx, gc.Client)
_, err = gc.Delete(ctx, resourceGroupName)
return err
}
// GetSubscriptionIDs Return available subscription IDs based on azure login

@ -331,7 +331,7 @@ func deleteResourceGroup(groupName string) {
helper := azure.NewACIResourceGroupHelper()
models, err := helper.GetSubscriptionIDs(ctx)
Expect(err).To(BeNil())
err = helper.Delete(ctx, *models[0].SubscriptionID, groupName)
err = helper.DeleteAsync(ctx, *models[0].SubscriptionID, groupName)
Expect(err).To(BeNil())
}