-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e test for service annotation 'ServiceAnnotationLoadBalancerRes…
…ourceGroup'.
- Loading branch information
t-qini
committed
Jul 30, 2019
1 parent
8a0c4fa
commit 935a9ef
Showing
15 changed files
with
6,420 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package utils | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" | ||
"github.com/Azure/go-autorest/autorest/to" | ||
|
||
"k8s.io/apimachinery/pkg/util/uuid" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
// CreateTestResourceGroup create a test rg | ||
func CreateTestResourceGroup(tc *AzureTestClient) (*resources.Group, func(string)) { | ||
gc := tc.createResourceGroupClient() | ||
rgName := to.StringPtr("e2e-" + string(uuid.NewUUID())[0:4]) | ||
rg, err := gc.CreateOrUpdate(context.Background(), *rgName, createTestTemplate(tc, rgName)) | ||
Expect(err).NotTo(HaveOccurred()) | ||
By(fmt.Sprintf("resource group %s created", *rgName)) | ||
|
||
return &rg, func(rgName string) { | ||
Logf("cleaning up test resource group %s", rgName) | ||
_, err := gc.Delete(context.Background(), rgName) | ||
Expect(err).NotTo(HaveOccurred()) | ||
return | ||
} | ||
} | ||
|
||
func createTestTemplate(tc *AzureTestClient, name *string) resources.Group { | ||
return resources.Group{ | ||
Name: name, | ||
Location: to.StringPtr(tc.location), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
.../github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.