This PR adds a large number of unit tests for the public endpoints. It also adds tests that feel a lot like unit tests for the endpoints that require authentication; these tests are technically integration tests, however, because they make actual queries to the Postgres DB to authenticate a user. (It might we worth creating a mock for the DB at some point, but this PR does not implement a mock).
This PR also adds a large number of documentation comments and shifts the information I previously placed in the README into a doc comment (which is a better home anyway). After this PR, running cargo doc --open generates a useful doc site that could form the basis of public-facing documentation if we want to go that route.
This PR does not add any integration tests for the actual streaming functionality—that is, no automated tests currently test the ability of the server to retrieve an update from Redis and send that update via a Server Sent Event. This would be very nice to include in a future PR, since it part of the core functionality. However, it would be a true integration test; it would require that the server be running, that it be connected to Postgres and Redis and that multiple clients make requests to the server. I have been manually testing this functionality with curl; hopefully we will be able to automate it at some point.
This PR adds a large number of unit tests for the public endpoints. It also adds tests that feel a lot like unit tests for the endpoints that require authentication; these tests are technically integration tests, however, because they make actual queries to the Postgres DB to authenticate a user. (It might we worth creating a mock for the DB at some point, but this PR does not implement a mock).
This PR also adds a large number of documentation comments and shifts the information I previously placed in the README into a doc comment (which is a better home anyway). After this PR, running
cargo doc --open
generates a useful doc site that could form the basis of public-facing documentation if we want to go that route.This PR does not add any integration tests for the actual streaming functionality—that is, no automated tests currently test the ability of the server to retrieve an update from Redis and send that update via a Server Sent Event. This would be very nice to include in a future PR, since it part of the core functionality. However, it would be a true integration test; it would require that the server be running, that it be connected to Postgres and Redis and that multiple clients make requests to the server. I have been manually testing this functionality with
curl
; hopefully we will be able to automate it at some point.