Skip to content

Commit

Permalink
Hacks to try to understand hanging test
Browse files Browse the repository at this point in the history
  • Loading branch information
babbageclunk committed Jan 14, 2021
1 parent 8c68932 commit 38e6a54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ generate-test-certs:
.PHONY: test-integration-controllers
test-integration-controllers: generate fmt vet manifests
TEST_RESOURCE_PREFIX=$(TEST_RESOURCE_PREFIX) TEST_USE_EXISTING_CLUSTER=false REQUEUE_AFTER=20 \
go test -v -tags "$(BUILD_TAGS)" -coverprofile=reports/integration-controllers-coverage-output.txt -coverpkg=./... -covermode count -parallel 4 -timeout 45m \
go test -v -tags "$(BUILD_TAGS)" -coverprofile=reports/integration-controllers-coverage-output.txt -coverpkg=./... -covermode count -parallel 4 -timeout 45m -run "TestMySQLUserControllerNoResourceGroup" \
./controllers/...
#2>&1 | tee reports/integration-controllers-output.txt
#go-junit-report < reports/integration-controllers-output.txt > reports/integration-controllers-report.xml
Expand Down
4 changes: 4 additions & 0 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ import (
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
"github.com/Azure/azure-service-operator/api/v1alpha2"
"github.com/Azure/azure-service-operator/api/v1beta1"

// +kubebuilder:scaffold:imports
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
Expand All @@ -85,6 +87,7 @@ var testEnv *envtest.Environment
var tc TestContext

func setup() error {
ctrl.SetLogger(zap.Logger(true))
log.Println(fmt.Sprintf("Starting common controller test setup"))

// Go ahead and assume that we're deployed in the default namespace for
Expand All @@ -95,6 +98,7 @@ func setup() error {
if err != nil {
return err
}
log.Println(resourcemanagerconfig.ConfigString())

resourceGroupName := GenerateTestResourceName("rg-prime")
resourcegroupLocation := resourcemanagerconfig.DefaultLocation()
Expand Down
6 changes: 4 additions & 2 deletions pkg/resourcemanager/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ func BaseURI() string {
func ConfigString() string {
creds := GlobalCredentials()
return fmt.Sprintf(
"clientID: %q, tenantID: %q, subscriptionID: %q, cloudName: %q, useDeviceFlow: %v, useManagedIdentity: %v, podNamespace: %q",
"clientID: %q, tenantID: %q, subscriptionID: %q, cloudName: %q, useDeviceFlow: %v, useManagedIdentity: %v, podNamespace: %q, operatorKeyvault: %q",
creds.ClientID(),
creds.TenantID(),
creds.SubscriptionID(),
cloudName,
UseDeviceFlow(),
creds.UseManagedIdentity(),
podNamespace)
podNamespace,
creds.OperatorKeyvault(),
)
}

0 comments on commit 38e6a54

Please sign in to comment.