frontier icon indicating copy to clipboard operation
frontier copied to clipboard

Shield end-to-end test

Open mabdh opened this issue 3 years ago • 0 comments

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

  1. Use an end-to-end testing framework and document the tests in a lightweight text like yaml or json - Need to create a reliable docker-compose to be run in the CI - Some framework like venom or tavern
  2. Write the end-to-end test in go from 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:

  1. Creating an end-to-end testbench (PR #152)
    • We will go with the 2nd approach above, write the end-to-end test in go from scratch. Reasons are:
      1. We will have more flexibility to do custom logic or preparation
      2. Not dependent to any test framework
      3. 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
  2. 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
  3. 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

mabdh avatar Jul 29 '22 13:07 mabdh