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

Tests #21

Closed
The-EDev opened this issue Oct 19, 2020 · 4 comments · Fixed by #130
Closed

Tests #21

The-EDev opened this issue Oct 19, 2020 · 4 comments · Fixed by #130
Labels
task Non code related issue

Comments

@The-EDev
Copy link
Member

The-EDev commented Oct 19, 2020

  • websocket.h is seemingly not being tested at all, should probably be addressed
  • mustache.h is quite low, not sure why, should probably be investigated.. mustachetest is not generating gcov files
  • Also I think there's no testing for SSL
@The-EDev The-EDev added the task Non code related issue label Oct 19, 2020
@The-EDev
Copy link
Member Author

The-EDev commented Oct 21, 2020

Update: Websockets suffer the same problem as request streaming, It sends data directly over the TCP socket (or SSL stream), which as far as I know isn't very testable, so aside from the setup code, there isn't much to test without some sort of fake read/write methods or some debug tools in ASIO (which I don't believe there are)

Edit: a simple client to test the received data might be useful, though I do not believe code coverage and unit tests are important enough to warrant dropping the main issues to write a client, maybe when the code is in a stable state, or if someone kindly opens a PR with such a client implemented

@The-EDev
Copy link
Member Author

Ok so after some research, data coming through a socket by creating our own socket and connecting it to an ioservice, similar to how it's done in tests like simple_url_params, IDK why I was too blind to see these tests, regardless. I'll be changing the tests for sendfile and request streaming to test using a socket, this should solve the issues above + a new issue i discovered where the tests don't even send the response (hence the lack of coverage for streaming)

@The-EDev The-EDev mentioned this issue Oct 27, 2020
@The-EDev The-EDev linked a pull request Oct 27, 2020 that will close this issue
@The-EDev The-EDev removed a link to a pull request Oct 27, 2020
@The-EDev
Copy link
Member Author

The-EDev commented Apr 14, 2021

It might be the case that Mustache Tests are not being considered in coverage. This could be due to the fact that the file being run is a python script that generates temporary files and runs the actual C++ test. Although I'm not 100% sure of it. only 85%

Update: I confirmed GCOV files are only being created for unittest

Update2: Adding a simple line to include mustachetest in coverage increased mustache.h coverage from 33.45% to 91.96% and finally got us out of the damn red zone

@The-EDev The-EDev changed the title Tests SSL Tests Apr 14, 2021
@The-EDev The-EDev changed the title SSL Tests Tests Apr 17, 2021
@The-EDev
Copy link
Member Author

SSL tests have been merged into revamped_setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Non code related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant