MobilityData / mobility-feed-api

Apache License 2.0
8 stars 3 forks source link

Propose how to improve testing process #448

Closed emmambd closed 4 months ago

emmambd commented 5 months ago

Describe the problem

We've identified that we want to

Proposed solution

Develop a clear process for the lifecycle and infrastructure changes we need to make to increase the efficiency of testing and be confident we've covered the critical use cases.

Alternatives you've considered

No response

Additional context

No response

jcpitre commented 5 months ago

Timebox: 1 day

jcpitre commented 5 months ago

To properly cover the test plan we to have data that reproduce conditions that might make the query fail (refer to the Limit problem) Solutions:

  1. Improve unit tests to add the conditions
    1. Con: We might have to artificially create a lot of data to reproduce the corner cases
  2. Identify data in our current QA or PROD database that reproduce the problem and tailor the query for that
    1. e.g. if we know that the limit problem happens with a certain feed, set the offset so the offending feed is included in the response
    2. Con: The DB changes over time and we might have to readjust the tests if they start failing because of the data
    3. Con: The DB might not contain all the data to reproduce corner cases.
  3. Have a special integration test that uses a DB created for that purpose.
    1. The DB would be filled with:
      1. A reduced version of source.csv that we control
      2. The equivalent of test_datasets.json to add missing data that can reproduce error conditions
    2. Con: probably more work
jcpitre commented 5 months ago

Currently we test the API with unit tests and integration tests. Here is a list of tests that should be added. Wether they go in the unit tests or the integration tests is TBD.

emmambd commented 5 months ago

Maybe some "nice-to-haves" that come to mind for me:

emmambd commented 4 months ago

Next step is for @jcpitre to create issues for each of the endpoints included here

emmambd commented 4 months ago

Closed and the above issues created to address this.