Skip to content

Commit

Permalink
chore: updated analysis_test.go
Browse files Browse the repository at this point in the history
Signed-off-by: chetan gupta <chetangupta123raj@gmail.com>
  • Loading branch information
chetanguptaa committed Apr 12, 2023
1 parent 21dc61c commit 825e9a4
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions pkg/analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package analysis
import (
"encoding/json"
"fmt"
"testing"

"github.com/k8sgpt-ai/k8sgpt/pkg/analyzer"
"github.com/stretchr/testify/require"
"testing"
)

func TestAnalysis_NoProblemJsonOutput(t *testing.T) {
Expand Down Expand Up @@ -42,11 +43,12 @@ func TestAnalysis_ProblemJsonOutput(t *testing.T) {
analysis := Analysis{
Results: []analyzer.Result{
{
"Deployment",
"test-deployment",
[]string{"test-problem"},
"test-solution",
"parent-resource"},
Kind: "Deployment",
Name: "test-deployment",
Error: []string{"test-problem"},
Details: "test-solution",
ParentObject: "parent-resource",
},
},
Namespace: "default",
}
Expand All @@ -55,11 +57,13 @@ func TestAnalysis_ProblemJsonOutput(t *testing.T) {
Status: StateProblemDetected,
Problems: 1,
Results: []analyzer.Result{
{"Deployment",
"test-deployment",
[]string{"test-problem"},
"test-solution",
"parent-resource"},
{
Kind: "Deployment",
Name: "test-deployment",
Error: []string{"test-problem"},
Details: "test-solution",
ParentObject: "parent-resource",
},
},
}

Expand All @@ -84,11 +88,12 @@ func TestAnalysis_MultipleProblemJsonOutput(t *testing.T) {
analysis := Analysis{
Results: []analyzer.Result{
{
"Deployment",
"test-deployment",
[]string{"test-problem", "another-test-problem"},
"test-solution",
"parent-resource"},
Kind: "Deployment",
Name: "test-deployment",
Error: []string{"test-problem", "another-test-problem"},
Details: "test-solution",
ParentObject: "parent-resource",
},
},
Namespace: "default",
}
Expand All @@ -97,11 +102,13 @@ func TestAnalysis_MultipleProblemJsonOutput(t *testing.T) {
Status: StateProblemDetected,
Problems: 2,
Results: []analyzer.Result{
{"Deployment",
"test-deployment",
[]string{"test-problem", "another-test-problem"},
"test-solution",
"parent-resource"},
{
Kind: "Deployment",
Name: "test-deployment",
Error: []string{"test-problem", "another-test-problem"},
Details: "test-solution",
ParentObject: "parent-resource",
},
},
}

Expand Down

0 comments on commit 825e9a4

Please sign in to comment.