From 648564eb4dd456f20b046549b1932ad56821aa66 Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Tue, 25 Feb 2020 16:42:00 -0800 Subject: [PATCH] Fix text_analyze_test (#142) --- pkg/analyze/cluster_version_test.go | 6 ++++++ pkg/analyze/container_runtime_test.go | 2 ++ pkg/analyze/deployment_status_test.go | 6 ++++++ pkg/analyze/text_analyze_test.go | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/pkg/analyze/cluster_version_test.go b/pkg/analyze/cluster_version_test.go index 64b05291..ef17d2f9 100644 --- a/pkg/analyze/cluster_version_test.go +++ b/pkg/analyze/cluster_version_test.go @@ -55,6 +55,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) { Title: "Check Fail", Message: "Sentry requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.", URI: "https://www.kubernetes.io", + IconKey: "kubernetes_cluster_version", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16", }, }, { @@ -69,6 +71,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) { Title: "Check Warn", Message: "Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.", URI: "https://www.kubernetes.io", + IconKey: "kubernetes_cluster_version", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16", }, }, { @@ -82,6 +86,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) { IsPass: true, Title: "Check Pass", Message: "Your cluster meets the recommended and required versions of Kubernetes.", + IconKey: "kubernetes_cluster_version", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16", }, }, } diff --git a/pkg/analyze/container_runtime_test.go b/pkg/analyze/container_runtime_test.go index 5e81b7eb..a866b40a 100644 --- a/pkg/analyze/container_runtime_test.go +++ b/pkg/analyze/container_runtime_test.go @@ -99,6 +99,8 @@ func Test_containerRuntime(t *testing.T) { IsFail: true, Title: "Container Runtime", Message: "containerd detected", + IconKey: "kubernetes_container_runtime", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/container-runtime.svg?w=23&h=16", }, files: map[string][]byte{ "cluster-resources/nodes.json": []byte(collectedNodes), diff --git a/pkg/analyze/deployment_status_test.go b/pkg/analyze/deployment_status_test.go index 08b7e8da..e4a2daca 100644 --- a/pkg/analyze/deployment_status_test.go +++ b/pkg/analyze/deployment_status_test.go @@ -41,6 +41,8 @@ func Test_deploymentStatus(t *testing.T) { IsFail: false, Title: "kotsadm-api Status", Message: "pass", + IconKey: "kubernetes_deployment_status", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", }, files: map[string][]byte{ "cluster-resources/deployments/default.json": []byte(collectedDeployments), @@ -71,6 +73,8 @@ func Test_deploymentStatus(t *testing.T) { IsFail: true, Title: "kotsadm-api Status", Message: "fail", + IconKey: "kubernetes_deployment_status", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", }, files: map[string][]byte{ "cluster-resources/deployments/default.json": []byte(collectedDeployments), @@ -107,6 +111,8 @@ func Test_deploymentStatus(t *testing.T) { IsFail: false, Title: "kotsadm-api Status", Message: "warn", + IconKey: "kubernetes_deployment_status", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", }, files: map[string][]byte{ "cluster-resources/deployments/default.json": []byte(collectedDeployments), diff --git a/pkg/analyze/text_analyze_test.go b/pkg/analyze/text_analyze_test.go index eaeecdd3..8d0b6fa6 100644 --- a/pkg/analyze/text_analyze_test.go +++ b/pkg/analyze/text_analyze_test.go @@ -72,6 +72,8 @@ func Test_textAnalyze(t *testing.T) { IsFail: true, Title: "text-collector-2", Message: "fail", + IconKey: "kubernetes_text_analyze", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg", }, files: map[string][]byte{ "text-collector-2/cfile-2.txt": []byte(""), @@ -102,6 +104,8 @@ func Test_textAnalyze(t *testing.T) { IsFail: true, Title: "", Message: "Invalid analyzer", + IconKey: "kubernetes_text_analyze", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg", }, files: map[string][]byte{ "text-collector-3/cfile-3.txt": []byte("Connection to service succeeded"), @@ -162,6 +166,8 @@ func Test_textAnalyze(t *testing.T) { IsFail: true, Title: "text-collector-4", Message: "fail", + IconKey: "kubernetes_text_analyze", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg", }, files: map[string][]byte{ "text-collector-4/cfile-4.txt": []byte("A different message"), @@ -192,6 +198,8 @@ func Test_textAnalyze(t *testing.T) { IsFail: true, Title: "text-collector-6", Message: "fail", + IconKey: "kubernetes_text_analyze", + IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg", }, files: map[string][]byte{ "text-collector-6/cfile-6.txt": []byte("A different message"),