Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 539 - specific test for nova group filter #646

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted file:

  • api_searchProducts_test.dart: added a specific test for nova group filter; switched tests to PROD env whenever possible

What

  • Just added a test on nova group filter - the filtering was already there (but was not really tested).

Fixes bug(s)

Impacted file:
* `api_searchProducts_test.dart`: added a specific test for nova group filter; switched tests to PROD env whenever possible
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Why the switch to the prod environment though, isn't the test env exactly for this?

@monsieurtanuki
Copy link
Contributor Author

Why the switch to the prod environment though, isn't the test env exactly for this?

That's an interesting question.

My point of view: in off-dart we're not here to test the server's own TEST env, we're here to test if what we coded works in the normal conditions (PROD), as integration or functional tests.
We are virtually forced to run some tests "not on PROD" though, when we save data.
Besides, the TEST env is rather unstable (not a big deal, it's a TEST env), and I prefer to crash the tests with our own bugs with PROD data than because of a test platform instability.

We could also:

  1. test whatever changed in server TEST that is not yet in server PROD (that would mean calling also in TEST our current tests in PROD), a bit like non regression tests
  2. completely ignore what the server says and use fake http calls - that's what some tests were about (and I got rid of them because they were actually testing jsonDecode), more like unit tests.

@monsieurtanuki monsieurtanuki merged commit 44dfd2d into openfoodfacts:master Dec 19, 2022
@monsieurtanuki
Copy link
Contributor Author

Btw, thank you @M123-dev for the review!

@teolemon teolemon added 🔎 Search 🧪 Tests NOVA groups NOVA is an indicator for food ultra-processing https://world.openfoodfacts.org/nova labels Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NOVA groups NOVA is an indicator for food ultra-processing https://world.openfoodfacts.org/nova 🔎 Search 🧪 Tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

nova_groups search parameter
3 participants