diff options
author | Azul <azul@riseup.net> | 2016-09-12 16:34:25 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-09-12 16:34:57 +0200 |
commit | ec875169b0231d84bb8c55bbe91c52b896561f1e (patch) | |
tree | bb4b47a79d32744bda8d66b2c02e9343bfc61698 /test/Readme.md | |
parent | bc8ddfa1c49b438a563a8a8b9e0472944f71c71c (diff) |
test: separate remote tests into own directory
Dropped the webmock dependency. We have our own http adapter. So we can
stub that to inject a mock. As an added bonus this does not mess with
other http requests.
Also wrote down testing strategy. Not completely implemented yet.
Diffstat (limited to 'test/Readme.md')
-rw-r--r-- | test/Readme.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Readme.md b/test/Readme.md new file mode 100644 index 0000000..d9a3de8 --- /dev/null +++ b/test/Readme.md @@ -0,0 +1,34 @@ +Testing Strategy +================ + +Dispatcher Integration Tests +---------------------------- + +The dispatcher hands the requests to different handlers and responds with the +first response it gets. We test the integration between the dispatcher and the +handlers. We do so by confirming that a given query is handed to the right +source in the expected manner. +In order to do so we mock the sources. We also keep the server out of the loop. +This way these tests should be deterministic and fast. + +Remote Tests +------------ + +Test the interaction of our sources with remote services. These tests make +use of the real network. Therefore they are prone to network errors and non- +deterministic server responses. With the expected result they will pass. Known +failure cases should be covered in a unit test and lead to skipping the remote +test. Unexpected remote behaviour should cause an Error. If you observe such an +error: + * create a unit test for the source that triggers the same behaviour + * handle it appropriately in the source + * change the integration test to skip if the same behaviour happens again. + + +Source Unit Tests +----------------- + +As described above these should cover all possible network issues and make sure +we return the right response in these cases. +We can trigger the observed remote behaviour by mocking the adapter and thus +make it deterministic. |