Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Fix test span counter #250

Merged
merged 1 commit into from
Jun 5, 2020
Merged

Fix test span counter #250

merged 1 commit into from
Jun 5, 2020

Conversation

tonyredondo
Copy link
Contributor

This PR fixes the test span counter used by the report message at the end of the tests.

@tonyredondo tonyredondo self-assigned this Jun 4, 2020
@@ -168,8 +169,10 @@ func (r *SpanRecorder) sendSpans() (error, bool) {

var testSpans int64
for _, span := range spans {
if isTestSpan(span) {
testSpans++
if tags, ok := span["tags"].(opentracing.Tags); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which cases it gave a wrong test span count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here: https://github.com/undefinedlabs/scope-go-agent/blob/fix-test-counter/agent/recorder.go#L181-L189

The problem with that counter, is that is being used here: https://github.com/undefinedlabs/scope-go-agent/blob/fix-test-counter/agent/report.go#L12

So if the that value is always zero, always return "success" while we have some KO in the backend...

@tonyredondo tonyredondo merged commit 0cbf581 into master Jun 5, 2020
@tonyredondo tonyredondo deleted the fix-test-counter branch June 5, 2020 13:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants