Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that tests do not leave any files behind #5229

Open
snejus opened this issue May 7, 2024 · 0 comments
Open

Ensure that tests do not leave any files behind #5229

snejus opened this issue May 7, 2024 · 0 comments
Labels
refactor testing Relates to the testing/CI infrastructure

Comments

@snejus
Copy link
Member

snejus commented May 7, 2024

I have been running tests across the codebase frequently these days and have just discovered thousands of files in my /tmp directory. For example, I checked which tests from test/plugins directory leave files behind:

for fi in test/plugins/*.py; do 
  print Testing $fi && pytest $fi &>/dev/null
  drs=(/tmp/tmp*)
  if (( $#drs )); then 
    print -l $drs && rm -r $drs
  fi
done
Testing test/plugins/__init__.py
Testing test/plugins/lyrics_download_samples.py
Testing test/plugins/test_acousticbrainz.py
Testing test/plugins/test_advancedrewrite.py
Testing test/plugins/test_albumtypes.py
Testing test/plugins/test_art.py
/tmp/tmp2gwz0iin.jpg
/tmp/tmp7gxr676p.jpg
/tmp/tmp88ypd9a4.png
/tmp/tmpc9_dhkt1.jpg
/tmp/tmpjlro_7kl.png
/tmp/tmprehbg2uh.jpg
/tmp/tmps37w1k7g.jpg
/usr/bin/rm: remove 7 arguments recursively? y
removed '/tmp/tmp2gwz0iin.jpg'
removed '/tmp/tmp7gxr676p.jpg'
removed '/tmp/tmp88ypd9a4.png'
removed '/tmp/tmpc9_dhkt1.jpg'
removed '/tmp/tmpjlro_7kl.png'
removed '/tmp/tmprehbg2uh.jpg'
removed '/tmp/tmps37w1k7g.jpg'
Testing test/plugins/test_bareasc.py
/tmp/tmposwaq51j
/tmp/tmpqdoitx3p
/tmp/tmpqj57zdnm
/usr/bin/rm: remove 3 arguments recursively? y
removed directory '/tmp/tmposwaq51j/libdir'
removed directory '/tmp/tmposwaq51j'
removed directory '/tmp/tmpqdoitx3p/libdir'
removed directory '/tmp/tmpqdoitx3p'
removed directory '/tmp/tmpqj57zdnm/libdir'
removed directory '/tmp/tmpqj57zdnm'
Testing test/plugins/test_beatport.py
Testing test/plugins/test_bucket.py
Testing test/plugins/test_convert.py
Testing test/plugins/test_discogs.py
Testing test/plugins/test_edit.py
Testing test/plugins/test_embedart.py
/tmp/tmp04pf5orx
/tmp/tmp0p3zrmvr
/tmp/tmp1c_13z5i
/tmp/tmp1iwishs_.jpg
/tmp/tmpfl7et0y5
/tmp/tmpfu9vpdi9
/tmp/tmph5to5ktl
/tmp/tmpiemkfj5o
/tmp/tmpn__of7he
/tmp/tmpp1hnf3dh
/tmp/tmppumez7dg
/tmp/tmpqxlwwq42.jpg
/tmp/tmpr__5fn99
/tmp/tmptks_h0e7
/tmp/tmpv7f27emo
/tmp/tmpvp2regn7
/tmp/tmpw8dq5diz
/tmp/tmpxy4kl2i8
/usr/bin/rm: remove 18 arguments recursively? y
removed directory '/tmp/tmp04pf5orx'
removed directory '/tmp/tmp0p3zrmvr'
removed directory '/tmp/tmp1c_13z5i'
removed '/tmp/tmp1iwishs_.jpg'
removed directory '/tmp/tmpfl7et0y5'
removed directory '/tmp/tmpfu9vpdi9'
removed directory '/tmp/tmph5to5ktl'
removed directory '/tmp/tmpiemkfj5o'
removed directory '/tmp/tmpn__of7he'
removed directory '/tmp/tmpp1hnf3dh'
removed directory '/tmp/tmppumez7dg'
removed '/tmp/tmpqxlwwq42.jpg'
removed directory '/tmp/tmpr__5fn99'
removed directory '/tmp/tmptks_h0e7'
removed directory '/tmp/tmpv7f27emo'
removed directory '/tmp/tmpvp2regn7'
removed directory '/tmp/tmpw8dq5diz'
removed directory '/tmp/tmpxy4kl2i8'
Testing test/plugins/test_embyupdate.py
Testing test/plugins/test_export.py
Testing test/plugins/test_fetchart.py
Testing test/plugins/test_filefilter.py
Testing test/plugins/test_ftintitle.py
Testing test/plugins/test_hook.py
Testing test/plugins/test_ihate.py
Testing test/plugins/test_importadded.py
Testing test/plugins/test_importfeeds.py
Testing test/plugins/test_info.py
Testing test/plugins/test_ipfs.py
Testing test/plugins/test_keyfinder.py
Testing test/plugins/test_lastgenre.py
Testing test/plugins/test_limit.py
Testing test/plugins/test_lyrics.py
Testing test/plugins/test_mbsubmit.py
Testing test/plugins/test_mbsync.py
Testing test/plugins/test_mpdstats.py
Testing test/plugins/test_parentwork.py
Testing test/plugins/test_permissions.py
Testing test/plugins/test_player.py
Testing test/plugins/test_playlist.py
Testing test/plugins/test_play.py
/tmp/tmp0on9a_ru.m3u
/tmp/tmp2lnwq43r.m3u
/tmp/tmp2rjt0boe.m3u
/tmp/tmp3tenj5ru.m3u
/tmp/tmp_6aguiwh.m3u
/tmp/tmp8ggf8znt.m3u
/tmp/tmpel0a12lq.m3u
/tmp/tmpwd0g39m_.m3u
/tmp/tmpwxpl0eas.m3u
/tmp/tmpxzytwbdp.m3u
/usr/bin/rm: remove 10 arguments recursively? y
removed '/tmp/tmp0on9a_ru.m3u'
removed '/tmp/tmp2lnwq43r.m3u'
removed '/tmp/tmp2rjt0boe.m3u'
removed '/tmp/tmp3tenj5ru.m3u'
removed '/tmp/tmp_6aguiwh.m3u'
removed '/tmp/tmp8ggf8znt.m3u'
removed '/tmp/tmpel0a12lq.m3u'
removed '/tmp/tmpwd0g39m_.m3u'
removed '/tmp/tmpwxpl0eas.m3u'
removed '/tmp/tmpxzytwbdp.m3u'
Testing test/plugins/test_plexupdate.py
Testing test/plugins/test_plugin_mediafield.py
Testing test/plugins/test_random.py
Testing test/plugins/test_replaygain.py
Testing test/plugins/test_smartplaylist.py
Testing test/plugins/test_spotify.py
Testing test/plugins/test_subsonicupdate.py
Testing test/plugins/test_the.py
Testing test/plugins/test_thumbnails.py
Testing test/plugins/test_types_plugin.py
Testing test/plugins/test_web.py
Testing test/plugins/test_zero.py
/tmp/tmp4jxe4d30
/usr/bin/rm: remove 1 argument recursively? y
removed '/tmp/tmp4jxe4d30'
@snejus snejus added refactor testing Relates to the testing/CI infrastructure labels May 7, 2024
@snejus snejus changed the title Ensure that tests do not any files behind Ensure that tests do not leave any files behind May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor testing Relates to the testing/CI infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant