From 74baaec7426c77d6cddeabb6f1ea1da993856ece Mon Sep 17 00:00:00 2001 From: Bevan Arps Date: Thu, 9 May 2024 12:30:14 +1200 Subject: [PATCH] Fix broken documentation link (#4004) * Improve headers for debugging logs * Fix broken link * Fix paragraph formatting --- .../add-a-new-code-generated-resource.md | 8 ++++---- v2/internal/testcommon/kube_per_test_context.go | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/hugo/content/contributing/add-a-new-code-generated-resource.md b/docs/hugo/content/contributing/add-a-new-code-generated-resource.md index 013a6ea8391..b789a81dfcb 100644 --- a/docs/hugo/content/contributing/add-a-new-code-generated-resource.md +++ b/docs/hugo/content/contributing/add-a-new-code-generated-resource.md @@ -273,13 +273,13 @@ WorkspaceProperties: ## Write a CRUD test for the resource -The best way to do this is to start from an [existing test](https://github.com/Azure/azure-service-operator/blob/main/v2/internal/controllers/crd_cosmosdb_mongodb_test.go) and modify it to work for your resource. It can also be helpful to refer to examples in the [ARM templates GitHub repo](https://github.com/Azure/azure-quickstart-templates). +The best way to do this is to start from an [existing test](https://github.com/Azure/azure-service-operator/blob/main/v2/internal/controllers/documentdb_mongodb_crud_v20231115_test.go) and modify it to work for your resource. It can also be helpful to refer to examples in the [ARM templates GitHub repo](https://github.com/Azure/azure-quickstart-templates). Every new resource should have a handwritten test as there is always the possibility that the way a particular resource provider behaves will change with a new version. -Given that we don't want to have to maintain tests for every version of every resource, and each additional test makes our CI test suite take lo -nger, consider removing tests for older versions of resources when we add tests for newer versions. This is a judgment call, and we recommend di -scussion with the team first. +Given that we don't want to have to maintain tests for every version of every resource, and each additional test makes our CI test suite take +longer, consider removing tests for older versions of resources when we add tests for newer versions. This is a judgment call, and we recommend +discussion with the team first. As an absolute minimum, we want to have tests for diff --git a/v2/internal/testcommon/kube_per_test_context.go b/v2/internal/testcommon/kube_per_test_context.go index 31ad6433cd3..3d8a89eec61 100644 --- a/v2/internal/testcommon/kube_per_test_context.go +++ b/v2/internal/testcommon/kube_per_test_context.go @@ -354,9 +354,16 @@ func (tc *KubePerTestContext) CreateTestResourceGroupAndWait() *resources.Resour // CreateResource creates a resource and registers it for cleanup. It does not wait for the resource // to be created, use CreateResourceAndWait for that func (tc *KubePerTestContext) CreateResource(obj client.Object) { - tc.LogSubsectionf( - "Creating resource %s", - obj.GetName()) + if arm, ok := obj.(genruntime.ARMMetaObject); ok { + tc.LogSubsectionf( + "Creating %s resource %s", + arm.GetType(), + obj.GetName()) + } else { + tc.LogSubsectionf( + "Creating resource %s", + obj.GetName()) + } tc.CreateResourceUntracked(obj) tc.registerCleanup(obj)