Skip to content

Commit

Permalink
feat: Use e2e testing infrastructure (kedacore#3753)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
  • Loading branch information
JorTurFer committed Jan 18, 2023
1 parent 12783c1 commit ab4ca9a
Show file tree
Hide file tree
Showing 27 changed files with 128 additions and 154 deletions.
49 changes: 4 additions & 45 deletions .github/workflows/pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,52 +122,16 @@ jobs:
run: |
gh pr checkout ${{ needs.triage.outputs.pr_num }}
- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Run end to end tests
continue-on-error: true
id: test
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AZURE_APP_INSIGHTS_APP_ID: ${{ secrets.AZURE_APP_INSIGHTS_APP_ID }}
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY }}
AZURE_DATA_EXPLORER_DB: ${{ secrets.AZURE_DATA_EXPLORER_DB }}
AZURE_DATA_EXPLORER_ENDPOINT: ${{ secrets.AZURE_DATA_EXPLORER_ENDPOINT }}
AZURE_DEVOPS_BUILD_DEFINITION_ID: ${{ secrets.AZURE_DEVOPS_BUILD_DEFINITION_ID }}
AZURE_DEVOPS_ORGANIZATION_URL: ${{ secrets.AZURE_DEVOPS_ORGANIZATION_URL }}
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
AZURE_DEVOPS_POOL_NAME: ${{ secrets.AZURE_DEVOPS_POOL_NAME }}
AZURE_DEVOPS_PROJECT: ${{ secrets.AZURE_DEVOPS_PROJECT }}
AZURE_KEYVAULT_URI: ${{ secrets.AZURE_KEYVAULT_URI }}
AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }}
AZURE_RUN_WORKLOAD_IDENTITY_TESTS: true
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SERVICE_BUS_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_CONNECTION_STRING }}
AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING }}
AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }}
AZURE_SP_OBJECT_ID: ${{ secrets.AZURE_SP_OBJECT_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
AZURE_SP_ALTERNATIVE_APP_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_APP_ID }}
AZURE_SP_ALTERNATIVE_OBJECT_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_OBJECT_ID }}
AZURE_SP_ALTERNATIVE_KEY: ${{ secrets.AZURE_SP_ALTERNATIVE_KEY }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}}
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY}}
DATADOG_SITE: ${{ secrets.DATADOG_SITE}}
E2E_IMAGE_TAG: ${{ needs.triage.outputs.image_tag }}
GCP_SP_KEY: ${{ secrets.GCP_SP_KEY }}
NEWRELIC_ACCOUNT_ID: ${{ secrets.NEWRELIC_ACCOUNT_ID}}
NEWRELIC_API_KEY: ${{ secrets.NEWRELIC_API_KEY}}
NEWRELIC_LICENSE: ${{ secrets.NEWRELIC_LICENSE}}
OIDC_ISSUER_URL: ${{ secrets.OIDC_ISSUER_URLPR }}
OPENSTACK_AUTH_URL: ${{ secrets.OPENSTACK_AUTH_URL }}
OPENSTACK_PASSWORD: ${{ secrets.OPENSTACK_PASSWORD }}
OPENSTACK_PROJECT_ID: ${{ secrets.OPENSTACK_PROJECT_ID }}
OPENSTACK_USER_ID: ${{ secrets.OPENSTACK_USER_ID }}
PREDICTKUBE_API_KEY: ${{ secrets.PREDICTKUBE_API_KEY }}
TEST_CLUSTER_NAME: keda-pr-run
run: |
MESSAGE="${{ github.event.comment.body }}"
Expand All @@ -183,11 +147,6 @@ jobs:
if: ${{ always() }}
run: make e2e-test-clean
env:
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
TEST_CLUSTER_NAME: keda-pr-run

- name: React to comment with success
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/v1-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:

- name: Run end to end tests
env:
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }}
TF_AZURE_SUBSCRIPTION: ${{ secrets.TF_AZURE_SUBSCRIPTION }}
TF_AZURE_RESOURCE_GROUP: ${{ secrets.TF_AZURE_RESOURCE_GROUP }}
TF_AZURE_SP_APP_ID: ${{ secrets.TF_AZURE_SP_APP_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }}
TF_AZURE_SP_TENANT: ${{ secrets.TF_AZURE_SP_TENANT }}
TF_AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.TF_AZURE_STORAGE_CONNECTION_STRING }}
TF_AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.TF_AZURE_LOG_ANALYTICS_WORKSPACE_ID }}
run: make e2e-test
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ test: manifests generate fmt vet envtest install-test-deps ## Run tests and expo

.PHONY: get-cluster-context
get-cluster-context: ## Get Azure cluster context.
@az login --service-principal -u $(AZURE_SP_APP_ID) -p "$(AZURE_SP_KEY)" --tenant $(AZURE_SP_TENANT)
@az login --service-principal -u $(TF_AZURE_SP_APP_ID) -p "$(AZURE_SP_KEY)" --tenant $(TF_AZURE_SP_TENANT)
@az aks get-credentials \
--name $(TEST_CLUSTER_NAME) \
--subscription $(AZURE_SUBSCRIPTION) \
--resource-group $(AZURE_RESOURCE_GROUP)
--subscription $(TF_AZURE_SUBSCRIPTION) \
--resource-group $(TF_AZURE_RESOURCE_GROUP)

.PHONY: e2e-test
e2e-test: get-cluster-context ## Run e2e tests against Azure cluster.
Expand Down Expand Up @@ -252,7 +252,7 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
if [ "$(AZURE_RUN_WORKLOAD_IDENTITY_TESTS)" = true ]; then \
cd config/service_account && \
$(KUSTOMIZE) edit add label --force azure.workload.identity/use:true; \
$(KUSTOMIZE) edit add annotation --force azure.workload.identity/client-id:${AZURE_SP_APP_ID} azure.workload.identity/tenant-id:${AZURE_SP_TENANT}; \
$(KUSTOMIZE) edit add annotation --force azure.workload.identity/client-id:${TF_AZURE_IDENTITY_1_APP_ID} azure.workload.identity/tenant-id:${TF_AZURE_SP_TENANT}; \
fi
# Need this workaround to mitigate a problem with inserting labels into selectors,
# until this issue is solved: https://github.com/kubernetes-sigs/kustomize/issues/1009
Expand Down
34 changes: 18 additions & 16 deletions tests/.env
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# OPENSTACK_REGION_NAME=
# OPENSTACK_SWIFT_URL=
AWS_ACCESS_KEY=
AWS_REGION=
AWS_SECRET_KEY=
AZURE_APP_INSIGHTS_APP_ID=
AZURE_APP_INSIGHTS_CONNECTION_STRING=
AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY=
AZURE_DATA_EXPLORER_DB=
AZURE_DATA_EXPLORER_ENDPOINT=
TF_AWS_ACCESS_KEY=
TF_AWS_REGION=
TF_AWS_SECRET_KEY=
TF_AZURE_APP_INSIGHTS_APP_ID=
TF_AZURE_APP_INSIGHTS_CONNECTION_STRING=
TF_AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY=
TF_AZURE_DATA_EXPLORER_DB=
TF_AZURE_DATA_EXPLORER_ENDPOINT=
AZURE_DEVOPS_BUILD_DEFINITION_ID=
AZURE_DEVOPS_ORGANIZATION_URL=
AZURE_DEVOPS_PAT=
AZURE_DEVOPS_POOL_NAME=
AZURE_DEVOPS_PROJECT=
AZURE_KEYVAULT_URI=
AZURE_LOG_ANALYTICS_WORKSPACE_ID=
AZURE_RESOURCE_GROUP=
AZURE_SP_APP_ID=
TF_AZURE_EVENTHBUS_MANAGEMENT_CONNECTION_STRING=
TF_AZURE_KEYVAULT_URI=
TF_AZURE_LOG_ANALYTICS_WORKSPACE_ID=
TF_AZURE_RESOURCE_GROUP=
TF_AZURE_SERVICE_BUS_CONNECTION_STRING=
TF_AZURE_SP_APP_ID=
AZURE_SP_KEY=
AZURE_SP_OBJECT_ID=
AZURE_SP_TENANT=
AZURE_STORAGE_CONNECTION_STRING=
AZURE_SUBSCRIPTION=
TF_AZURE_SP_OBJECT_ID=
TF_AZURE_SP_TENANT=
TF_AZURE_STORAGE_CONNECTION_STRING=
TF_AZURE_SUBSCRIPTION=
DATADOG_APP_KEY=
DATADOG_API_KEY=
DATADOG_SITE=
Expand Down
12 changes: 11 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- [go](https://go.dev/)
- `kubectl` logged into a Kubernetes cluster.
- Each scaler test might define additional requirements. For example, `azure_queue_test.go` requires an env var `AZURE_STORAGE_CONNECTION_STRING`
- Each scaler test might define additional requirements. For example, `azure_queue_test.go` requires an env var `TF_AZURE_STORAGE_CONNECTION_STRING`

## Running tests:

Expand Down Expand Up @@ -193,3 +193,13 @@ you're trying to achieve is too complicated or tedious using above, use `ParseCo
for executing shell commands.
- Ensure, ensure, ensure that you're cleaning up resources.
- You can use `VS Code` for easily debugging your tests.

## E2E Test infrastructure

For improving the reliability of e2e test, we try to have all resources under kedacore control using kedacore docker images rather end-users registry images (without official support) and cloud resources in kedacore accounts.

In order to manage these e2e resources, there are 2 different repositories:
- [kedacore/test-tools](https://github.com/kedacore/test-tools) for docker images management.
- [kedacore/testing-infrastructure](https://github.com/kedacore/testing-infrastructure) for cloud resources.

If any change is needed in e2e test infrastructure, please open a PR in those repositories and use kedacore resources for e2e tests.
2 changes: 1 addition & 1 deletion tests/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var random = rand.New(rand.NewSource(time.Now().UnixNano()))

// Env variables required for setup and cleanup.
var (
AzureADTenantID = os.Getenv("AZURE_SP_TENANT")
AzureADTenantID = os.Getenv("TF_AZURE_SP_TENANT")
AzureRunWorkloadIdentityTests = os.Getenv("AZURE_RUN_WORKLOAD_IDENTITY_TESTS")
)

Expand Down
2 changes: 1 addition & 1 deletion tests/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ E2E_REGEX="./*${E2E_TEST_REGEX:-*_test.go}"
DIR=$(dirname "$0")
cd $DIR

concurrent_tests_limit=8
concurrent_tests_limit=12
pids=()
lookup=()
failed_count=0
Expand Down
8 changes: 4 additions & 4 deletions tests/scalers/aws_cloudwatch/aws_cloudwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ var (
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
secretName = fmt.Sprintf("%s-secret", testName)
cloudwatchMetricName = fmt.Sprintf("%s-keda-metric-%d", testName, GetRandomNumber())
awsAccessKeyID = os.Getenv("AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("AWS_REGION")
cloudwatchMetricName = fmt.Sprintf("cw-%d", GetRandomNumber())
awsAccessKeyID = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("TF_AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
cloudwatchMetricNamespace = "KEDA"
cloudwatchMetricDimensionName = "dimensionName"
cloudwatchMetricDimensionValue = "dimensionValue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ var (
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
secretName = fmt.Sprintf("%s-secret", testName)
cloudwatchMetricName = fmt.Sprintf("%s-keda-metric-%d", testName, GetRandomNumber())
awsAccessKeyID = os.Getenv("AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("AWS_REGION")
cloudwatchMetricName = fmt.Sprintf("cw-expr-%d", GetRandomNumber())
awsAccessKeyID = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("TF_AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
cloudwatchMetricNamespace = "KEDA_EXPRESSION"
cloudwatchMetricDimensionName = "dimensionName"
cloudwatchMetricDimensionValue = "dimensionValue"
Expand Down
8 changes: 4 additions & 4 deletions tests/scalers/aws_dynamodb/aws_dynamodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ var (
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
secretName = fmt.Sprintf("%s-secret", testName)
dynamoDBTableName = fmt.Sprintf("%s-keda-table-%d", testName, GetRandomNumber())
awsAccessKeyID = os.Getenv("AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("AWS_REGION")
dynamoDBTableName = fmt.Sprintf("table-%d", GetRandomNumber())
awsAccessKeyID = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("TF_AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
expressionAttributeNames = "{ \"#k\" : \"event_type\"}"
keyConditionExpression = "#k = :key"
expressionAttributeValues = "{ \":key\" : {\"S\":\"scaling_event\"}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const (
)

var (
awsRegion = os.Getenv("AWS_REGION")
awsAccessKey = os.Getenv("AWS_ACCESS_KEY")
awsSecretKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
awsAccessKey = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretKey = os.Getenv("TF_AWS_SECRET_KEY")
testNamespace = fmt.Sprintf("%s-ns", testName)
secretName = fmt.Sprintf("%s-secret", testName)
deploymentName = fmt.Sprintf("%s-deployment", testName)
triggerAuthName = fmt.Sprintf("%s-ta", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
tableName = fmt.Sprintf("%s-table-%d", testName, GetRandomNumber())
tableName = fmt.Sprintf("stream-%d", GetRandomNumber())
shardCount = 2 // default count
activationShardCount = 0 // default count
)
Expand Down
8 changes: 4 additions & 4 deletions tests/scalers/aws_kinesis_stream/aws_kinesis_stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ var (
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
secretName = fmt.Sprintf("%s-secret", testName)
kinesisStreamName = fmt.Sprintf("%s-keda-stream-%d", testName, GetRandomNumber())
awsAccessKeyID = os.Getenv("AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("AWS_REGION")
kinesisStreamName = fmt.Sprintf("kinesis-%d", GetRandomNumber())
awsAccessKeyID = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("TF_AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
maxReplicaCount = 2
minReplicaCount = 0
)
Expand Down
8 changes: 4 additions & 4 deletions tests/scalers/aws_sqs_queue/aws_sqs_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ var (
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
secretName = fmt.Sprintf("%s-secret", testName)
sqsQueueName = fmt.Sprintf("%s-keda-queue-%d", testName, GetRandomNumber())
awsAccessKeyID = os.Getenv("AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("AWS_SECRET_KEY")
awsRegion = os.Getenv("AWS_REGION")
sqsQueueName = fmt.Sprintf("queue-%d", GetRandomNumber())
awsAccessKeyID = os.Getenv("TF_AWS_ACCESS_KEY")
awsSecretAccessKey = os.Getenv("TF_AWS_SECRET_KEY")
awsRegion = os.Getenv("TF_AWS_REGION")
maxReplicaCount = 2
minReplicaCount = 0
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const (
)

var (
appInsightsAppID = os.Getenv("AZURE_APP_INSIGHTS_APP_ID")
appInsightsInstrumentationKey = os.Getenv("AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY")
appInsightsConnectionstring = os.Getenv("AZURE_APP_INSIGHTS_CONNECTION_STRING")
appInsightsMetricName = fmt.Sprintf("%s-%d", testName, GetRandomNumber())
appInsightsAppID = os.Getenv("TF_AZURE_APP_INSIGHTS_APP_ID")
appInsightsInstrumentationKey = os.Getenv("TF_AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY")
appInsightsConnectionstring = os.Getenv("TF_AZURE_APP_INSIGHTS_CONNECTION_STRING")
appInsightsMetricName = fmt.Sprintf("metric-%d", GetRandomNumber())
appInsightsRole = fmt.Sprintf("%s-role", testName)
azureADClientID = os.Getenv("AZURE_SP_APP_ID")
azureADClientID = os.Getenv("TF_AZURE_SP_APP_ID")
azureADSecret = os.Getenv("AZURE_SP_KEY")
azureADTenantID = os.Getenv("AZURE_SP_TENANT")
azureADTenantID = os.Getenv("TF_AZURE_SP_TENANT")
testNamespace = fmt.Sprintf("%s-ns", testName)
secretName = fmt.Sprintf("%s-secret", testName)
deploymentName = fmt.Sprintf("%s-deployment", testName)
Expand Down Expand Up @@ -148,12 +148,12 @@ spec:
func TestScaler(t *testing.T) {
// setup
t.Log("--- setting up ---")
require.NotEmpty(t, appInsightsAppID, "AZURE_APP_INSIGHTS_APP_ID env variable is required for application insights tests")
require.NotEmpty(t, appInsightsInstrumentationKey, "AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY env variable is required for application insights tests")
require.NotEmpty(t, appInsightsConnectionstring, "AZURE_APP_INSIGHTS_CONNECTION_STRING env variable is required for application insights tests")
require.NotEmpty(t, azureADClientID, "AZURE_SP_APP_ID env variable is required for application insights tests")
require.NotEmpty(t, appInsightsAppID, "TF_AZURE_APP_INSIGHTS_APP_ID env variable is required for application insights tests")
require.NotEmpty(t, appInsightsInstrumentationKey, "TF_AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY env variable is required for application insights tests")
require.NotEmpty(t, appInsightsConnectionstring, "TF_AZURE_APP_INSIGHTS_CONNECTION_STRING env variable is required for application insights tests")
require.NotEmpty(t, azureADClientID, "TF_AZURE_SP_APP_ID env variable is required for application insights tests")
require.NotEmpty(t, azureADSecret, "AZURE_SP_KEY env variable is required for application insights tests")
require.NotEmpty(t, azureADTenantID, "AZURE_SP_TENANT env variable is required for application insights tests")
require.NotEmpty(t, azureADTenantID, "TF_AZURE_SP_TENANT env variable is required for application insights tests")
client := appinsights.NewTelemetryClient(appInsightsInstrumentationKey)

// Create kubernetes resources
Expand Down
6 changes: 3 additions & 3 deletions tests/scalers/azure_blob/azure_blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const (
)

var (
connectionString = os.Getenv("AZURE_STORAGE_CONNECTION_STRING")
connectionString = os.Getenv("TF_AZURE_STORAGE_CONNECTION_STRING")
testNamespace = fmt.Sprintf("%s-ns", testName)
secretName = fmt.Sprintf("%s-secret", testName)
deploymentName = fmt.Sprintf("%s-deployment", testName)
scaledObjectName = fmt.Sprintf("%s-so", testName)
containerName = fmt.Sprintf("%s-container-%d", testName, GetRandomNumber())
containerName = fmt.Sprintf("container-%d", GetRandomNumber())
)

type templateData struct {
Expand Down Expand Up @@ -126,7 +126,7 @@ spec:
func TestScaler(t *testing.T) {
// setup
t.Log("--- setting up ---")
require.NotEmpty(t, connectionString, "AZURE_STORAGE_CONNECTION_STRING env variable is required for azure blob test")
require.NotEmpty(t, connectionString, "TF_AZURE_STORAGE_CONNECTION_STRING env variable is required for azure blob test")

containerURL := createContainer(t)

Expand Down
Loading

0 comments on commit ab4ca9a

Please sign in to comment.