Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

testing: add a basic integration test#110

Merged
keep94 merged 1 commit intowavefrontHQ:masterfrom
LukeWinikates:integration-test
Oct 24, 2022
Merged

testing: add a basic integration test#110
keep94 merged 1 commit intowavefrontHQ:masterfrom
LukeWinikates:integration-test

Conversation

@LukeWinikates
Copy link
Copy Markdown
Contributor

In the process of working on #109 , I was worried about not having automated end-to-end test coverage, and I thought that even a simple test against a local http server might make it easier to refactor the sdk internals with greater confidence.

@keep94 what do you think?

cc: @suprajanarasimhan @ktollivervmw

Copy link
Copy Markdown
Contributor

@keep94 keep94 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this integration test, LukeWinikates. I'd like to see this test use the httptest.Server type which binds to a random opened port. Recently I had trouble running a test suite of a library because I was already running a service on the same port it happened to be trying to use.

@LukeWinikates LukeWinikates requested a review from keep94 October 12, 2022 20:20
Copy link
Copy Markdown
Contributor

@keep94 keep94 left a comment

Choose a reason for hiding this comment

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

Thanks LukeWinikates for this work. Just a few minor comments.

@LukeWinikates LukeWinikates requested a review from keep94 October 17, 2022 16:07
Copy link
Copy Markdown
Contributor

@keep94 keep94 left a comment

Choose a reason for hiding this comment

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

Just one comment.

metricLines = append(metricLines, line)
}
if scanner.Err() != nil {
return metricLines, scanner.Err()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you get here, you will leak the gzip.Reader

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch! I just pushed a change adding reader.Close() right before this line. That seems like a reasonable choice but it did have me wishing I could just use defer.

Copy link
Copy Markdown
Contributor

@keep94 keep94 left a comment

Choose a reason for hiding this comment

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

LTGM

@keep94 keep94 merged commit 04d1795 into wavefrontHQ:master Oct 24, 2022
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