Added integration testings - #30
Conversation
|
Important note: to make the integration testing failed i found a bug in the connections map, which we fixed in the previous PR, but since the PR was not merged, the new tests are not gonna pass. This will be drafted until all PRs will be added here is the full bug i found: Bug: Data race on
|
|
I have a suggestion, instead of adding a guard connections with a std::mutex to the conection. We can make the connections std::unordered_map value a shared_ptr (Which has a reference count. When that reference count drops to 0 we free it.). |
|
Can you make sure that after the Integration testing the Data is not persisted anywhere. because if we ran the code locally and the data got persisted this will cause problems in terms of testing itself, because we want to operate on clean data. |
|
Fire Brother! |
| last_error = None | ||
| for _ in range(self.max_retries): | ||
| try: | ||
| self.sock.sendall((command + "\n").encode()) |
There was a problem hiding this comment.
Client already appends \n on send and waits for it on recv, matches the server's framing check. so no change needed
There was a problem hiding this comment.
What i mean is that \n asccii is not 0x0A .
Do you get what I mean?
if you click enter on you keyboard it doesn't add a \n it will add 0x0A. Lets just align our expectations.
Do we want a simple enter or an intentional /n.
Also I think it should be a '/n' in order for it to be 0x0A.
Not "/n" can you double check?
|
I will have to add a simple file deletion after running tests to wipe out test data from the log files |
|
im stuck in a weird spot the code passes tests on windows but not on docker |
|
@razimograbi Finally got everything to work, had to adjust tests to sit into 1 file because it was running the tests in the wrong order, and I have to add a line that will add the thread lib into windows build test for some reason the last test didnt find it so I manually added it, Added the #24 to this PR and fixed connections thing so code ready for review |
Summary
This pull request was created in order to make sure that the project is running fully using integration testing and not just unit testing as it is usefull but not enough
Related issue
Closes # NONE
Type of change
How was this tested?
The project is being tested locally so far after this addition it will add CI testing
Checklist
cmake --build build)ctest --test-dir build)