Skip to content

Test Function Skipped: Name Does Not Start with 'Test' #6784

@THE-BRAHMA

Description

@THE-BRAHMA

Report

The test function is not being executed because its name does not start with Test. In Go, test functions must follow the naming convention func TestXxx(t *testing.T) in order to be recognized and run by the go test command. Since this function doesn't follow that pattern, it gets skipped during test execution.

Expected Behavior

While running the below test all test functions should be called.

go test -v -tags e2e ./utils/setup_test.go

Actual Behavior

Since, below test funciton in setup_test.go is miss spelled, so it's not getting called.

func TesVerifyPodsIdentity(t *testing.T) {
	if AzureRunWorkloadIdentityTests == StringTrue {
		assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "azure-wi-webhook-controller-manager", "azure-workload-identity-system", 2, 30, 6),
			"replica count should be 1 after 3 minutes")
	}

	if AwsIdentityTests == StringTrue {
		assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "aws-identity-webhook", "aws-identity-system", 1, 30, 6),
			"replica count should be 1 after 3 minutes")
	}

	if GcpIdentityTests == StringTrue {
		assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "gcp-identity-webhook-controller-manager", "gcp-identity-system", 1, 30, 6),
			"replica count should be 1 after 3 minutes")
	}
}

Steps to Reproduce the Problem

Run the command

go test -v -tags e2e ./utils/setup_test.go

Logs from KEDA operator

example

KEDA Version

None

Kubernetes Version

None

Platform

None

Scaler Details

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions