Closed Woseseltops closed 5 years ago
The test that checks that they are not empty does not erase anything. I exported all datasets on my local machine, did a listing, ran the test, did a listing. The sizes of all the files remain the same before and after the test. (I included date timestamps.)
In the listing you also see some old ecv files. (The ones from February.) The export ecv uses the dataset acronym as the filename. We used to use the dataset name before we had acronyms. NGT used to be the same.
This was changed to the acronym because the filenames need to be compared to figure out which dataset they belong to. Because the software internally removes spaces from dataset names, the acronym is used in order to support reverse mapping from the filename (i.e., acronym) to the dataset.
The test gives a warning for filenames that don't match any dataset acronym.
These ought to be removed since they are obsolete. Here is what the test output looks like on my machine. As you can see from the listing (date timestamps) all of the files remain the same size.
Okay, there are more ecv tests.... This test actually exports the test dataset: tests.ImportExportTests.test_DatasetListView_ECV_export_permission_change_dataset Yes, it overwrites the real ecv file! The tests will need to modify the dataset acronym first or it will never work to test the real code.
Okay, it's been solved. Here are the same screenshots, listings before and after, and the output of the test.
The revised tests have been pushed to github.
So indeed some unit test was overwriting production ECVs?
@Woseseltops, this has already been solved and pushed to github. That's why I assigned it back to you.
It now already happened several times that the ASL ECV needed to regenerated, even when I didn't touch anything ECV-related, and I didn't understand why. An email by Lee Prunier yesterday suggests that the problem is caused by running the unit tests:
Please investigate if running the unittests can overwrite the ECV, and if yes: fix.
Related to #563