4 - API (tests): Add ('Recorded') End-to-End Tests#229
Conversation
17e6b7d to
9349f50
Compare
bd0db2e to
934a15f
Compare
9349f50 to
0d3a985
Compare
|
The CI test workflow would fail if the KeyCloak URL env var is not linked. Could you please add it to the repo accordingly and change the test-api.yml with something similar?:
Please use the test KeyCloak instance. |
934a15f to
d3b6985
Compare
4afcf68 to
c8ef2ed
Compare
d3b6985 to
0a44707
Compare
c8ef2ed to
c5c9b7f
Compare
0a44707 to
9288103
Compare
c5c9b7f to
c38fdcc
Compare
9288103 to
d15702f
Compare
c38fdcc to
2d39500
Compare
d15702f to
7b7216a
Compare
92d115c to
22719a6
Compare
22719a6 to
a454529
Compare
|
Done, thanks. Changed DW_API_AUTH__SERVER_METADATA_URL: ${{ vars.KEYCLOAK_METADATA_URL }}and set the repo Actions variable |
|
I mispoke: the KeyCloak instance doesn't matter, it's the same metadata server thoughout. LGTM |
3967e92 to
9dd4463
Compare
PR no. 4 of the big refactor.
This PR adds some 'black box' end to end tests which perform API calls to the server to do the tests, and compare the results with expected values. They (almost) never test functions directly, the point of these tests is to be here throughout the refactoring to verify things still (mostly and hopefully) behave the same as before as far as clients/the frontend is concerned.
Details
Lines changed are not as scary as they look, majority of this is external API calls/data that the server needs to be able to respond and stored responses to compare against.
Data
During the tests a few sources of data are used to give the server what it needs to respond and to give the tests something to compare against:
syrupused to make comparing the api responses easier (alternative is a billionassert expected[x] == result[x]checks)Mock MyMdC Client
Decided to update the mocked client implementation, before there was some hand-written
mymdc.jsonfile that it used to respond, how the mock client (1) responds with the cassette data and (2) is just used directly in the tests.