webcompat / webcompat.com

Source code for webcompat.com
https://webcompat.com
360 stars 191 forks source link

[test] Create a test topsite db for testing webhooks #3173

Open karlcow opened 4 years ago

karlcow commented 4 years ago

Some tests have a dependency on getting the right labels. If a test makes a query to a populated sites.db, the test will return a different set of labels.

There are two options:

  1. mocking everywhere we request the labels.
  2. Create a db when we are running tests with the right information in it.

Option 2 seems a better choice. We could rationalize it to a couple of controlled domains for our tests.

This mainly impacts webhooks tests

karlcow commented 4 years ago

See https://github.com/webcompat/webcompat.com/pull/3167/commits/f5ad195fc293fdf0504b0fd635ecf32f14aa7927 for the origin of this requirement.