mirror of
https://github.com/docker/compose.git
synced 2025-07-25 22:54:54 +02:00
Merge pull request #307 from docker/aci_e2e_group
Random ACI group name for tests, otherwise we are conflicting with each other + the CI
This commit is contained in:
commit
a48c4fb41c
@ -19,6 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -41,15 +42,18 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
resourceGroupName = "resourceGroupTest"
|
|
||||||
location = "westeurope"
|
location = "westeurope"
|
||||||
contextName = "acitest"
|
contextName = "acitest"
|
||||||
|
|
||||||
testContainerName = "testcontainername"
|
testContainerName = "testcontainername"
|
||||||
|
testShareName = "dockertestshare"
|
||||||
|
testFileContent = "Volume mounted with success!"
|
||||||
|
testFileName = "index.html"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
subscriptionID string
|
subscriptionID string
|
||||||
|
resourceGroupName = "resourceGroupTestE2E-" + RandStringBytes(10)
|
||||||
|
testStorageAccountName = "storageteste2e" + RandStringBytes(6) // "between 3 and 24 characters in length and use numbers and lower-case letters only"
|
||||||
)
|
)
|
||||||
|
|
||||||
type E2eACISuite struct {
|
type E2eACISuite struct {
|
||||||
@ -258,13 +262,6 @@ func (s *E2eACISuite) TestACIBackend() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
testStorageAccountName = "dockertestaccount"
|
|
||||||
testShareName = "dockertestshare"
|
|
||||||
testFileContent = "Volume mounted with success!"
|
|
||||||
testFileName = "index.html"
|
|
||||||
)
|
|
||||||
|
|
||||||
func createStorageAccount(aciContext store.AciContext, accountName string) azure_storage.Account {
|
func createStorageAccount(aciContext store.AciContext, accountName string) azure_storage.Account {
|
||||||
log.Println("Creating storage account " + accountName)
|
log.Println("Creating storage account " + accountName)
|
||||||
storageAccount, err := storage.CreateStorageAccount(context.TODO(), aciContext, accountName)
|
storageAccount, err := storage.CreateStorageAccount(context.TODO(), aciContext, accountName)
|
||||||
@ -334,3 +331,13 @@ func deleteResourceGroup(groupName string) {
|
|||||||
err = helper.Delete(ctx, *models[0].SubscriptionID, groupName)
|
err = helper.Delete(ctx, *models[0].SubscriptionID, groupName)
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RandStringBytes(n int) string {
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
const digits = "0123456789"
|
||||||
|
b := make([]byte, n)
|
||||||
|
for i := range b {
|
||||||
|
b[i] = digits[rand.Intn(len(digits))]
|
||||||
|
}
|
||||||
|
return string(b)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user