From 86bce54d1209ebff86b36fad4c7afa6d3ab6c6ec Mon Sep 17 00:00:00 2001 From: Joseph Callen Date: Wed, 9 Jul 2025 10:33:19 -0400 Subject: [PATCH] Update vsphere vm-host zonal e2e logging This commit changes the expected output to not include the topology of the infra. That output has been moved to By() --- test/e2e/vsphere/hostzonal.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/vsphere/hostzonal.go b/test/e2e/vsphere/hostzonal.go index 06a79f391c..416c8db527 100644 --- a/test/e2e/vsphere/hostzonal.go +++ b/test/e2e/vsphere/hostzonal.go @@ -223,9 +223,10 @@ func failIfMachineIsNotInCorrectRegionZone(ctx context.Context, } } - if !foundRegion || !foundZone { - Expect(fmt.Errorf("node %s missing expected region '%s' or zone '%s' tags", n.Name, fd.Region, fd.Zone)).NotTo(HaveOccurred()) - } + By(fmt.Sprintf("Node %s (VM: %s) - Region: %s (found: %t), Zone: %s (found: %t)", + n.Name, vm.Name(), fd.Region, foundRegion, fd.Zone, foundZone)) + + Expect(foundRegion && foundZone).To(BeTrue(), "expected vm to be in the correct region and zone") } } } @@ -293,9 +294,8 @@ func failIfMachineIsNotInCorrectVMGroup(ctx context.Context, } for moRef, v := range foundMoRef { - if !v { - Expect(fmt.Errorf("virtual machine id %s was not in vm group %s", moRef, fd.ZoneAffinity.HostGroup.VMGroup)).NotTo(HaveOccurred()) - } + By(fmt.Sprintf("managed object reference %s, vm group %s", moRef, fd.ZoneAffinity.HostGroup.VMGroup)) + Expect(v).To(BeTrue(), "expected to find node in vm group") } } }