Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Investigate: ECV unit tests seem to overwrite ECVs? #575

Closed Woseseltops closed 5 years ago

Woseseltops commented 5 years ago

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:

There was one interesting situation, but I appear to have fixed it myself by clicking the "ECV" button on the ASL SignBank website. When I double-clicked on an ASL gloss annotation, instead of the full ASL SignBank ECV I got an ECV with one entry ("thisisatemporarytestgloss")

Please investigate if running the unittests can overwrite the ECV, and if yes: fix.

Related to #563

susanodd commented 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.)

ecv-directory-listing-before-and-after-test

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. ecv-test-output

susanodd commented 5 years ago

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.

susanodd commented 5 years ago

Okay, it's been solved. Here are the same screenshots, listings before and after, and the output of the test.

second-ecv-test-listing-before-and-after

second-ecv-test-output

susanodd commented 5 years ago

The revised tests have been pushed to github.

Woseseltops commented 5 years ago

So indeed some unit test was overwriting production ECVs?

susanodd commented 5 years ago

@Woseseltops, this has already been solved and pushed to github. That's why I assigned it back to you.