Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ steps:
from_secret: GCS_SERVICE_ACCOUNT
GCS_PROJECT_ID:
from_secret: GOOGLE_CLOUD_PROJECT
ATHENS_AZURE_ACCOUNT_NAME:
from_secret: ATHENS_AZURE_ACCOUNT_NAME
ATHENS_ACCOUNT_NAME:
from_secret: AZURE_ACCOUNT_NAME
ATHENS_AZURE_ACCOUNT_KEY:
from_secret: ATHENS_AZURE_ACCOUNT_KEY
when:
Expand Down
13 changes: 8 additions & 5 deletions pkg/stash/with_azureblob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
// is done synchronously so that only the first module gets saved.
func TestWithAzureBlob(t *testing.T) {
containerName := randomContainerName(os.Getenv("DRONE_PULL_REQUEST"))
cfg := getAzureTestConfig(containerName)

cfg := getAzureTestConfig(t, containerName)
if cfg == nil {
t.SkipNow()
}
Expand Down Expand Up @@ -84,14 +85,16 @@ func (ms *mockAzureBlobStasher) Stash(ctx context.Context, mod, ver string) (str
return "", fmt.Errorf("second time error")
}

func getAzureTestConfig(containerName string) *config.AzureBlobConfig {
func getAzureTestConfig(t *testing.T, containerName string) *config.AzureBlobConfig {
key := os.Getenv("ATHENS_AZURE_ACCOUNT_KEY")
if key == "" {
t.Log("ATHENS_AZURE_ACCOUNT_KEY not provided.")
return nil
}
name := os.Getenv("ATHENS_AZURE_ACCOUNT_NAME")
name := os.Getenv("AZURE_ACCOUNT_NAME")
if name == "" {
return nil
t.Log("AZURE_ACCOUNT_NAME not provided, falling back to 'athens'.")
name = "athens"
}
return &config.AzureBlobConfig{
AccountName: name,
Expand All @@ -105,7 +108,7 @@ func randomContainerName(prefix string) string {
// see https://github.com/technosophos/moniker for more details
namer := moniker.New()
if prefix != "" {
return fmt.Sprintf("%s_%s", prefix, namer.NameSep(""))
return fmt.Sprintf("%s-%s", prefix, namer.NameSep(""))
}
return namer.NameSep("")
}