Taxonomy testing: Difference between revisions
(Created page with "Category:Taxonomies") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | |||
Warning: be sure what you are doing. These tests are there for a reason. Sometimes you should not change the test, as it will break other things in the system. Usually there is a comment found above the term in the taxonomy that warns you. | |||
== Finding the test results file == | |||
The files you need to edit for updating the tests are found in directory [https://github.com/openfoodfacts/openfoodfacts-server/tree/main/tests/unit tests/unit]. Which file you need to look is shown at the top of the test fail message. That file should be somewhere in the tests/unit directory.<br> | |||
<nowiki>Must put an example here.</nowiki><br> | |||
Locate in that file the test that failed based on the text that was checked. This part has an header that corresponds to a filename. This files can be found in the folder [https://github.com/openfoodfacts/openfoodfacts-server/tree/main/tests/unit/expected_test_results expected_test_results] in the test/units directory. Select the directory corresponding to the taxonomy where the test failure occurred. | |||
== Correcting the test results file == | |||
Now you can open that file and correct the error. | |||
<nowiki>Lets explain this with an example</nowiki> | |||
[[Category:Taxonomies]] | [[Category:Taxonomies]] |
Latest revision as of 11:53, 9 October 2022
Introduction
Warning: be sure what you are doing. These tests are there for a reason. Sometimes you should not change the test, as it will break other things in the system. Usually there is a comment found above the term in the taxonomy that warns you.
Finding the test results file
The files you need to edit for updating the tests are found in directory tests/unit. Which file you need to look is shown at the top of the test fail message. That file should be somewhere in the tests/unit directory.
Must put an example here.
Locate in that file the test that failed based on the text that was checked. This part has an header that corresponds to a filename. This files can be found in the folder expected_test_results in the test/units directory. Select the directory corresponding to the taxonomy where the test failure occurred.
Correcting the test results file
Now you can open that file and correct the error.
Lets explain this with an example