Scenario 8: Unit Test Verification

Objective: Verify all unit tests pass across the four affected test suites.

Environment: Local workstation, branch fix-OCPBUGS-100054 at commit 98271e5bd2, Go 1.24.3 darwin/arm64

Overall Scenario 8: PASS — 42/42 tests passing across 4 suites.
StepCheckResultEvidence
1 DNS Config tests (support/globalconfig/) PASS 4/4 tests (1.065s)
2 Service Publishing Strategy tests (cmd/cluster/core/) PASS 9/9 tests (0.941s)
3 Azure CLI Fixture tests (cmd/cluster/azure/) PASS 12/12 tests (0.868s)
4 CPO Infra Reconciliation tests (control-plane-operator/.../infra/) PASS 17/17 tests (1.291s)
Total automated unit tests42/42 PASS

Commands & Outputs

Step 1: DNS Config tests

$ go test ./support/globalconfig/ -run TestReconcileDNSConfig -v
=== RUN   TestReconcileDNSConfig
=== RUN   TestReconcileDNSConfig/when_DNS_parameters_specified_then_they_are_copied_to_the_DNS_object
=== RUN   TestReconcileDNSConfig/when_IBMCloud_platform_then_it_should_use_hcp_basedomain
=== RUN   TestReconcileDNSConfig/when_AWS_SharedVPC_then_it_should_set_PrivateZoneIAMRole
=== RUN   TestReconcileDNSConfig/when_DNS_parameters_not_specified_then_DNS_object_is_empty
--- PASS: TestReconcileDNSConfig (0.00s)
    --- PASS: TestReconcileDNSConfig/when_DNS_parameters_specified_then_they_are_copied_to_the_DNS_object (0.00s)
    --- PASS: TestReconcileDNSConfig/when_IBMCloud_platform_then_it_should_use_hcp_basedomain (0.00s)
    --- PASS: TestReconcileDNSConfig/when_AWS_SharedVPC_then_it_should_set_PrivateZoneIAMRole (0.00s)
    --- PASS: TestReconcileDNSConfig/when_DNS_parameters_not_specified_then_DNS_object_is_empty (0.00s)
PASS
ok  	github.com/openshift/hypershift/support/globalconfig	1.065s

Step 2: Service Publishing Strategy tests

$ go test ./cmd/cluster/core/ -run TestGetServicePublishingStrategyMapping -v
=== RUN   TestGetServicePublishingStrategyMapping
=== RUN   TestGetServicePublishingStrategyMapping/When_called_without_external_DNS,_it_should_use_LoadBalancer_for_APIServer
=== RUN   TestGetServicePublishingStrategyMapping/When_called_with_external_DNS,_it_should_use_Route_for_APIServer
=== RUN   TestGetServicePublishingStrategyMapping/When_called_with_Private_endpoint_access_(no_external_DNS),_it_should_use_Route_for_APIServer
=== RUN   TestGetServicePublishingStrategyMapping/When_called_with_Private_endpoint_access_and_external_DNS,_it_should_use_Route_for_APIServer
=== RUN   TestGetServicePublishingStrategyMapping/When_called_without_external_DNS,_it_should_use_Route_for_Ignition
=== RUN   TestGetServicePublishingStrategyMapping/When_called_without_external_DNS,_it_should_use_Route_for_Konnectivity
=== RUN   TestGetServicePublishingStrategyMapping/When_called_without_external_DNS,_it_should_use_Route_for_OAuthServer
=== RUN   TestGetServicePublishingStrategyMapping/When_called_with_external_DNS,_it_should_use_Route_for_Ignition
=== RUN   TestGetServicePublishingStrategyMapping/When_called_with_external_DNS,_it_should_use_Route_for_Konnectivity
--- PASS: TestGetServicePublishingStrategyMapping (0.00s)
    --- PASS: ... (9 subtests)
PASS
ok  	github.com/openshift/hypershift/cmd/cluster/core	0.941s

Step 3: Azure CLI Fixture tests

$ go test ./cmd/cluster/azure/ -run TestCreateCluster -v
=== RUN   TestCreateCluster
=== RUN   TestCreateCluster/When_endpoint-access_is_Private_it_should_render_HostedCluster_with_Private_endpoint_access
=== RUN   TestCreateCluster/When_endpoint-access_is_Public_it_should_render_HostedCluster_with_Public_endpoint_access
=== RUN   TestCreateCluster/When_endpoint-access_is_PublicAndPrivate_it_should_render_HostedCluster_with_PublicAndPrivate_endpoint_access
...
--- PASS: TestCreateCluster (0.00s)
    --- PASS: ... (12 subtests)
PASS
ok  	github.com/openshift/hypershift/cmd/cluster/azure	0.868s

Step 4: CPO Infra Reconciliation tests

$ go test ./control-plane-operator/controllers/hostedcontrolplane/infra/ -v
=== RUN   TestReconcileInfrastructure
=== RUN   TestReconcileInfrastructure/When_Azure_Private_cluster_has_Route_strategy_without_hostname,_it_should_only_need_an_internal_router
=== RUN   TestReconcileInfrastructure/When_transitioning_from_public_to_private,_it_should_clean_up_public_resources
...
--- PASS: TestReconcileInfrastructure (0.00s)
    --- PASS: ... (17 subtests)
PASS
ok  	github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/infra	1.291s

Key Test Cases for This PR

SuiteTest NameWhat It Validates
core When called without external DNS, it should use LoadBalancer for APIServer Non-Private topology defaults KAS to LoadBalancer (no regression)
core When called with external DNS, it should use Route for APIServer External DNS triggers Route strategy for KAS
azure When endpoint-access is Private it should render HostedCluster with Private endpoint access Private fixture includes publicZoneID (aligned with AWS behavior)
infra Route strategy, Private without hostname — internal route only CPO creates only internal KAS route when no hostname configured
infra Transitioning from public to private should clean up public resources Obsolete external routes deleted during topology transition
globalconfig when DNS parameters specified then they are copied to the DNS object Both publicZone and privateZone propagated to guest dns.cluster

Full test details with source code links: Automated Tests

← Scenario 7 Dashboard →