Skip to content

Commit

Permalink
Merge pull request #2617 from chuckha/capd-artifact-output
Browse files Browse the repository at this point in the history
🏃Improve capd e2e artifact output
  • Loading branch information
k8s-ci-robot authored Mar 10, 2020
2 parents 37706a1 + 5348476 commit a9e0495
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 1 addition & 8 deletions test/infrastructure/docker/e2e/docker_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,12 @@ var _ = BeforeSuite(func() {
})

var _ = AfterSuite(func() {
// Dump the logs of the providers before deleting them.
Expect(writeLogs(mgmt, "capi-system", "capi-controller-manager", logPath)).To(Succeed())
Expect(writeLogs(mgmt, "capi-kubeadm-bootstrap-system", "capi-kubeadm-bootstrap-controller-manager", logPath)).To(Succeed())
Expect(writeLogs(mgmt, "capi-kubeadm-control-plane-system", "capi-kubeadm-control-plane-controller-manager", logPath)).To(Succeed())
Expect(writeLogs(mgmt, "capd-system", "capd-controller-manager", logPath)).To(Succeed())

// Dump cluster API and docker related resources to artifacts
Expect(framework.DumpResources(mgmt, resourcesPath, GinkgoWriter)).To(Succeed())
resources := map[string]runtime.Object{
"DockerCluster": &infrav1.DockerClusterList{},
"DockerMachine": &infrav1.DockerMachineList{},
}
Expect(framework.DumpProviderResources(mgmt, resources, resourcesPath, GinkgoWriter)).To(Succeed())

By("Deleting the management cluster")
// If any part of teardown fails it will print what must be manually cleaned up
mgmt.Teardown(ctx)
Expand Down
10 changes: 10 additions & 0 deletions test/infrastructure/docker/e2e/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/runtime"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -56,6 +57,15 @@ var _ = Describe("Docker", func() {
})

AfterEach(func() {
// Dump cluster API and docker related resources to artifacts before deleting them.
Expect(framework.DumpResources(mgmt, resourcesPath, GinkgoWriter)).To(Succeed())
resources := map[string]runtime.Object{
"DockerCluster": &infrav1.DockerClusterList{},
"DockerMachine": &infrav1.DockerMachineList{},
"DockerMachineTemplate": &infrav1.DockerMachineTemplateList{},
}
Expect(framework.DumpProviderResources(mgmt, resources, resourcesPath, GinkgoWriter)).To(Succeed())

deleteClusterInput := framework.DeleteClusterInput{
Deleter: client,
Cluster: cluster,
Expand Down

0 comments on commit a9e0495

Please sign in to comment.