Taxonomy testing

From Open Food Facts wiki
Jump to navigation Jump to search

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