Skip to content

Commit

Permalink
Added some assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrolds committed Dec 18, 2024
1 parent 6b0d910 commit 71d903d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ func Test_Main_SampleXML(t *testing.T) {
assertStringValueInAttribute(t, srvVersionAttribute.Value, "")

instrumentationLibrarySpans := resourceSpans.InstrumentationLibrarySpans[0]

assert.Equal(t, "jaeger-srv-test", instrumentationLibrarySpans.InstrumentationLibrary.Name)

spans := instrumentationLibrarySpans.Spans
Expand Down Expand Up @@ -355,6 +354,22 @@ func Test_Main_SampleXML(t *testing.T) {
// last span is server type
aTestCase = spans[expectedSpansCount-1]
assert.Equal(t, "SPAN_KIND_SERVER", aTestCase.Kind)

// metrics
resourceMetrics := testReport.resourceMetrics.Metrics[0]
metrics := resourceMetrics.InstrumentationLibraryMetrics[0].Metrics

assert.Equal(t, "tests.suite.error", metrics[0].Name)
assert.Equal(t, "tests.suite.failed", metrics[1].Name)
assert.Equal(t, "tests.suite.skipped", metrics[2].Name)
assert.Equal(t, "tests.suite.passed", metrics[3].Name)
assert.Equal(t, "tests.suite.total", metrics[4].Name)
assert.Equal(t, "tests.suite.duration", metrics[5].Name)
assert.Equal(t, "tests.suite.duration.histogram", metrics[6].Name)

assert.Equal(t, "tests.case.passed", metrics[7].Name)
assert.Equal(t, "tests.case.duration", metrics[8].Name)
assert.Equal(t, "tests.case.duration.histogram", metrics[9].Name)
}

func Test_GetServiceVariable(t *testing.T) {
Expand Down

0 comments on commit 71d903d

Please sign in to comment.