You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/12/19 09:50:07 UTC

[camel-k] 08/10: Fix #921: add more info on test failure

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 6ac761d488c689fc98c23d86226866a11f729771
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Wed Dec 18 23:25:55 2019 +0100

    Fix #921: add more info on test failure
---
 e2e/util/dump.go | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/e2e/util/dump.go b/e2e/util/dump.go
index b07f2ed..f5ae69c 100644
--- a/e2e/util/dump.go
+++ b/e2e/util/dump.go
@@ -23,6 +23,8 @@ import (
 	"testing"
 
 	"github.com/apache/camel-k/pkg/client"
+	"github.com/apache/camel-k/pkg/client/clientset/versioned"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 	v1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
@@ -32,12 +34,30 @@ func Dump(c client.Client, ns string, t *testing.T) error {
 
 	t.Logf("-------------------- start dumping namespace %s --------------------\n", ns)
 
+	camelClient, err := versioned.NewForConfig(c.GetConfig())
+	if err != nil {
+		return err
+	}
+	pls, err := camelClient.CamelV1().IntegrationPlatforms(ns).List(metav1.ListOptions{})
+	if err != nil {
+		return err
+	}
+	t.Logf("Found %d platforms:\n", len(pls.Items))
+	for _, p := range pls.Items {
+		ref := p
+		pdata, err := kubernetes.ToYAML(&ref)
+		if err != nil {
+			return err
+		}
+		t.Logf("---\n%s\n---\n", string(pdata))
+	}
+
 	lst, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{})
 	if err != nil {
 		return err
 	}
 
-	t.Logf("Found %d pods:\n", len(lst.Items))
+	t.Logf("\nFound %d pods:\n", len(lst.Items))
 	for _, pod := range lst.Items {
 		t.Logf("name=%s\n", pod.Name)
 		dumpConditions("  ", pod.Status.Conditions, t)