diff --git a/tests/scalers/azure/azure_pipelines/azure_pipelines_test.go b/tests/scalers/azure/azure_pipelines/azure_pipelines_test.go index 88b2ef1ba27..7ecf24c7acc 100644 --- a/tests/scalers/azure/azure_pipelines/azure_pipelines_test.go +++ b/tests/scalers/azure/azure_pipelines/azure_pipelines_test.go @@ -7,6 +7,7 @@ import ( "context" "encoding/base64" "fmt" + "math" "os" "strconv" "testing" @@ -158,6 +159,17 @@ spec: ` ) +func inject(src string) string { + l := len(src) + if l == 1 { + return src + } + mid := l / 2 + left := int(math.Round(float64(mid))) + right := l - left + return src[:left] + "__" + src[right:] +} + func TestScaler(t *testing.T) { // setup t.Log("--- setting up ---") @@ -167,11 +179,11 @@ func TestScaler(t *testing.T) { require.NotEmpty(t, buildID, "AZURE_DEVOPS_BUILD_DEFINITION_ID env variable is required for azure blob test") require.NotEmpty(t, poolName, "AZURE_DEVOPS_POOL_NAME env variable is required for azure blob test") - t.Logf("AZURE_DEVOPS_ORGANIZATION_URL=%s", base64.StdEncoding.EncodeToString([]byte(organizationURL))) - t.Logf("AZURE_DEVOPS_PAT=%s", base64.StdEncoding.EncodeToString([]byte(personalAccessToken))) - t.Logf("AZURE_DEVOPS_PROJECT=%s", base64.StdEncoding.EncodeToString([]byte(project))) - t.Logf("AZURE_DEVOPS_BUILD_DEFINITION_ID=%s", base64.StdEncoding.EncodeToString([]byte(buildID))) - t.Logf("AZURE_DEVOPS_POOL_NAME=%s", base64.StdEncoding.EncodeToString([]byte(poolName))) + t.Logf("AZURE_DEVOPS_ORGANIZATION_URL=%s", inject(organizationURL)) + t.Logf("AZURE_DEVOPS_PAT=%s", inject(personalAccessToken)) + t.Logf("AZURE_DEVOPS_PROJECT=%s", inject(project)) + t.Logf("AZURE_DEVOPS_BUILD_DEFINITION_ID=%s", inject(buildID)) + t.Logf("AZURE_DEVOPS_POOL_NAME=%s", inject(poolName)) connection := azuredevops.NewPatConnection(organizationURL, personalAccessToken) clearAllBuilds(t, connection)