Skip to content

Commit

Permalink
Improve logging for self-hosted e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
  • Loading branch information
killianmuldoon committed Oct 30, 2023
1 parent 0eb51f0 commit b76b791
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/e2e/self_hosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
if selfHostedNamespace != nil {
// Dump all Cluster API related resources to artifacts before pivoting back.
dumpAllResources(ctx, selfHostedClusterProxy, input.ArtifactFolder, namespace, clusterResources.Cluster)

// Dump logs from the Machines and infrastructure.
input.BootstrapClusterProxy.CollectWorkloadClusterLogs(ctx, namespace.Name, clusterResources.Cluster.Name, filepath.Join(input.ArtifactFolder, "clusters", clusterResources.Cluster.Name))

Check failure on line 402 in test/e2e/self_hosted.go

View workflow job for this annotation

GitHub Actions / lint (test)

unnecessary trailing newline (whitespace)
}
if selfHostedCluster != nil {
By("Ensure API servers are stable before doing move")
Expand Down
1 change: 1 addition & 0 deletions test/framework/cluster_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func (p *clusterProxy) GetWorkloadCluster(ctx context.Context, namespace, name s
// CollectWorkloadClusterLogs collects machines and infrastructure logs and from the workload cluster.
func (p *clusterProxy) CollectWorkloadClusterLogs(ctx context.Context, namespace, name, outputPath string) {
if p.logCollector == nil {
fmt.Printf("Failed to get logs for workload Cluster %s: log collector is nil", klog.KRef(namespace, name))
return
}

Expand Down
4 changes: 2 additions & 2 deletions test/framework/machine_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func WaitForControlPlaneMachinesToBeUpgraded(ctx context.Context, input WaitForC
}
}
if len(machines) > upgraded {
return 0, errors.New("old nodes remain")
return 0, errors.New("old Machines remain")
}
return upgraded, nil
}, intervals...).Should(Equal(input.MachineCount), "Timed out waiting for all control-plane machines in Cluster %s to be upgraded to kubernetes version %s", klog.KObj(input.Cluster), input.KubernetesUpgradeVersion)
Expand Down Expand Up @@ -209,7 +209,7 @@ func WaitForMachineDeploymentMachinesToBeUpgraded(ctx context.Context, input Wai
}
}
if len(machines) > upgraded {
return 0, errors.New("old nodes remain")
return 0, errors.New("old Machines remain")
}
return upgraded, nil
}, intervals...).Should(Equal(input.MachineCount), "Timed out waiting for all MachineDeployment %s Machines to be upgraded to kubernetes version %s", klog.KObj(&input.MachineDeployment), input.KubernetesUpgradeVersion)
Expand Down

0 comments on commit b76b791

Please sign in to comment.