MCPcopy
hub / github.com/keploy/keploy / TestBuildJUnitSuites_ObsoleteSkipped

Function TestBuildJUnitSuites_ObsoleteSkipped

pkg/service/report/junit_test.go:96–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestBuildJUnitSuites_ObsoleteSkipped(t *testing.T) {
97 reports := map[string]*models.TestReport{
98 "test-set-1": {
99 Total: 2,
100 Success: 1,
101 Obsolete: 1,
102 Tests: []models.TestResult{
103 {
104 TestCaseID: "tc-1",
105 Status: models.TestStatusPassed,
106 },
107 {
108 TestCaseID: "tc-2",
109 Status: models.TestStatusObsolete,
110 },
111 },
112 },
113 }
114
115 suites := buildJUnitSuites(reports)
116 suite := suites.Suites[0]
117
118 if suite.Skipped != 1 {
119 t.Errorf("expected 1 skipped, got %d", suite.Skipped)
120 }
121 if suite.Cases[1].Skipped == nil {
122 t.Error("expected skip element for obsolete test")
123 }
124 if suite.Cases[1].Skipped.Message != "obsolete test case" {
125 t.Errorf("expected 'obsolete test case' message, got %q", suite.Cases[1].Skipped.Message)
126 }
127}
128
129func TestBuildJUnitSuites_IgnoredSkipped(t *testing.T) {
130 reports := map[string]*models.TestReport{

Callers

nothing calls this directly

Calls 2

buildJUnitSuitesFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected