Fix text_analyze_test (#142)

This commit is contained in:
Salah Al Saleh
2020-02-25 16:42:00 -08:00
committed by GitHub
parent 45c7d95ebe
commit 648564eb4d
4 changed files with 22 additions and 0 deletions

View File

@@ -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",
},
},
}

View File

@@ -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),

View File

@@ -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),

View File

@@ -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"),