dachad / tcpgoon

tcpgoon, maximum TCP connections tester
MIT License
193 stars 21 forks source link

Issue15 - Increasing mtcpclient test coverage #55

Closed dcaba closed 6 years ago

dcaba commented 6 years ago

Adding test coverage for all reporting functions in this package.

However, worth to say: there's a public one (returns strings), then a private (similar, but just returns the metrics struct) and a helper function (std dev calculator). I find the tests for the first two functions are a bit overlapping/duplicated (it just changes the format), and we have the typical controversia of.. should we test private functions? See https://stackoverflow.com/questions/105007/should-i-test-private-methods-or-only-public-ones . In any case, here they are... overall test coverage will increase a lot!

coveralls commented 6 years ago

Coverage Status

Coverage increased (+19.5%) to 59.871% when pulling e242d0778ed743915f1a08245a5114f56838c7ba on Issue15mtcpclientTestCoverage into 2963718366a944d0212b7238be4a72216506466f on master.

dcaba commented 6 years ago

I've just added a fix we had pending: simple lock to prevent concurrent writes in the tcpserver we use for testing.. so I hope we have stable tests again!

dcaba commented 6 years ago

I can merge. Or I can wait for your merge. If I merge, you may need to adapt something... but it may be useful given the refactors (so you ensure these tests do continue working... somehow :nerd_face: )