Friday, June 28, 2019

Re: Running tests creates many unnecessary files

Hi,

I run the tests with manage.py test and there is a local virtualenv I created.

I noticed that only specific tests create files in media and not all of them. I'm not sure where the code that creates these files come from, we are using a lot of third party code.


On Fri, Jun 28, 2019 at 7:49 PM Phako Perez <13.phakman@gmail.com> wrote:
As per my understanding all test runs in a virtual environment and all data(files, variables databases) are deleted once test clmpletes, how are you running these test, are you using a specific library from python or using own tests in a personal file?

Sent from my iPhone

On Jun 28, 2019, at 08:43, אורי <uri@speedy.net> wrote:

Hi,

I found out that in the directory media of Speedy Net (https://github.com/speedy-net/speedy-net) on my computer, there are more than 200,000 unnecessary files and more than 20,000 folders. I checked the time the files were created and it seems that they were created because I ran Django tests locally. Why are so many files and folders created and remain undeleted after the tests end? I would expect all the temporary files to be deleted when the tests end. We have many tests (I think more than 1,000 tests - https://travis-ci.org/speedy-net/speedy-net/builds/551457609) and I ran them many times but I didn't expect so many unnecessary files to be created on my computer. Is there something I can do to prevent it?

I just ran all the tests locally now, after I deleted all the previous files and folder in media, and I found out that 903 files and 1,041 folders were created. I'm not sure which of our tests created these files and folders. Most of these files are either .jpg or .dat files. Is it possible to delete all these files automatically after the tests end?

Thanks,

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABD5YeF9JbEVNz_XvGrSTqjR%3Dj9mWkP3pdYf%2BiET3yzm%2B9j59w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/BB769359-933B-4570-B24B-819031E9DBB6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABD5YeFDY5%2BieGATBu0UnHUQiC4cXAR16KKj%2B3U88pS%3DpwY6Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment