Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve end-to-end tests #478

Open
grobie opened this issue Feb 28, 2017 · 2 comments
Open

Improve end-to-end tests #478

grobie opened this issue Feb 28, 2017 · 2 comments

Comments

@grobie
Copy link
Member

grobie commented Feb 28, 2017

The end-to-end tests currently only work under Linux, but we should also test all other collectors for other OSes. Instead of comparing the output to one single golden template, each collector probably needs their own file.

Rewriting the end-to-end tests to Go will probably make things easier.

@mdlayher
Copy link
Contributor

I'd be happy to help out with that project.

Something I've adopted on my own (that may or may not be ideal), is a test function that grabs the byte slice output from a collector using a net/http/httptest server: https://github.com/mdlayher/rtorrent_exporter/blob/master/rtorrentexporter_test.go#L12.

From there, you can explicitly search for sub-slices using bytes or regexp as needed.

At the very least, it does give you the ability to t.Skip where needed.

@discordianfish
Copy link
Member

@mdlayher Is this still something you want to look into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants