frontier
frontier copied to clipboard
Shield end-to-end test
Is your feature request related to a problem? Please describe. Shield has 2 main actors, server and proxy. Both are the highest level component and could only be covered by end-to-end test.
Describe the solution you'd like We will have 2 kind of end-to-end test
- Proxy Test
- Make sure the logic in proxy is satisfied
- API Test
- Make sure all APIs are working as expected
Implementation
- Use an end-to-end testing framework and document the tests in a lightweight text like
yamlorjson- Need to create a reliable docker-compose to be run in the CI - Some framework like venom or tavern - Write the end-to-end test in
gofrom scratch - Could be implemented as a test suite with testify - Use dockertest to automate docker testing
Broken down tasks We can break down this into 3 task:
- Creating an end-to-end testbench (PR #152)
- We will go with the 2nd approach above, write the end-to-end test in
gofrom scratch. Reasons are:- We will have more flexibility to do custom logic or preparation
- Not dependent to any test framework
- Less external/binary dependency(ies)
- The testbench would initiate all components needed (postgres, spicedb, shield server) and do migrations
- Some samples data are needed to check what to be expected
- We will go with the 2nd approach above, write the end-to-end test in
- Add API end-to-end tests
- API scenarios might be more straight forward but there are a lot of cases even for an API, we need to care about the error code too
- Implement the tests
- Add Proxy end-to-end tests
- Need to figure out what would be the scenario to test and edge cases that would happen
- Implement the tests