Skip to content

Commit 648564e

Browse files
author
Salah Al Saleh
authored
Fix text_analyze_test (#142)
1 parent 45c7d95 commit 648564e

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

pkg/analyze/cluster_version_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) {
5555
Title: "Check Fail",
5656
Message: "Sentry requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.",
5757
URI: "https://www.kubernetes.io",
58+
IconKey: "kubernetes_cluster_version",
59+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16",
5860
},
5961
},
6062
{
@@ -69,6 +71,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) {
6971
Title: "Check Warn",
7072
Message: "Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.",
7173
URI: "https://www.kubernetes.io",
74+
IconKey: "kubernetes_cluster_version",
75+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16",
7276
},
7377
},
7478
{
@@ -82,6 +86,8 @@ func Test_analyzeClusterVersionResult(t *testing.T) {
8286
IsPass: true,
8387
Title: "Check Pass",
8488
Message: "Your cluster meets the recommended and required versions of Kubernetes.",
89+
IconKey: "kubernetes_cluster_version",
90+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16",
8591
},
8692
},
8793
}

pkg/analyze/container_runtime_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ func Test_containerRuntime(t *testing.T) {
9999
IsFail: true,
100100
Title: "Container Runtime",
101101
Message: "containerd detected",
102+
IconKey: "kubernetes_container_runtime",
103+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/container-runtime.svg?w=23&h=16",
102104
},
103105
files: map[string][]byte{
104106
"cluster-resources/nodes.json": []byte(collectedNodes),

pkg/analyze/deployment_status_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ func Test_deploymentStatus(t *testing.T) {
4141
IsFail: false,
4242
Title: "kotsadm-api Status",
4343
Message: "pass",
44+
IconKey: "kubernetes_deployment_status",
45+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
4446
},
4547
files: map[string][]byte{
4648
"cluster-resources/deployments/default.json": []byte(collectedDeployments),
@@ -71,6 +73,8 @@ func Test_deploymentStatus(t *testing.T) {
7173
IsFail: true,
7274
Title: "kotsadm-api Status",
7375
Message: "fail",
76+
IconKey: "kubernetes_deployment_status",
77+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
7478
},
7579
files: map[string][]byte{
7680
"cluster-resources/deployments/default.json": []byte(collectedDeployments),
@@ -107,6 +111,8 @@ func Test_deploymentStatus(t *testing.T) {
107111
IsFail: false,
108112
Title: "kotsadm-api Status",
109113
Message: "warn",
114+
IconKey: "kubernetes_deployment_status",
115+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
110116
},
111117
files: map[string][]byte{
112118
"cluster-resources/deployments/default.json": []byte(collectedDeployments),

pkg/analyze/text_analyze_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func Test_textAnalyze(t *testing.T) {
7272
IsFail: true,
7373
Title: "text-collector-2",
7474
Message: "fail",
75+
IconKey: "kubernetes_text_analyze",
76+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
7577
},
7678
files: map[string][]byte{
7779
"text-collector-2/cfile-2.txt": []byte(""),
@@ -102,6 +104,8 @@ func Test_textAnalyze(t *testing.T) {
102104
IsFail: true,
103105
Title: "",
104106
Message: "Invalid analyzer",
107+
IconKey: "kubernetes_text_analyze",
108+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
105109
},
106110
files: map[string][]byte{
107111
"text-collector-3/cfile-3.txt": []byte("Connection to service succeeded"),
@@ -162,6 +166,8 @@ func Test_textAnalyze(t *testing.T) {
162166
IsFail: true,
163167
Title: "text-collector-4",
164168
Message: "fail",
169+
IconKey: "kubernetes_text_analyze",
170+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
165171
},
166172
files: map[string][]byte{
167173
"text-collector-4/cfile-4.txt": []byte("A different message"),
@@ -192,6 +198,8 @@ func Test_textAnalyze(t *testing.T) {
192198
IsFail: true,
193199
Title: "text-collector-6",
194200
Message: "fail",
201+
IconKey: "kubernetes_text_analyze",
202+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
195203
},
196204
files: map[string][]byte{
197205
"text-collector-6/cfile-6.txt": []byte("A different message"),

0 commit comments

Comments
 (0)