progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
621 stars 174 forks source link

clean up after tests #1553

Closed mapreri closed 6 months ago

mapreri commented 1 year ago

Hello @progval ! :)

So, somebody is now trying to enforce a rule that in Debian has actually always been written but nobody ever bothered with it...

Regardless, it is something that does make sense, so I'm reporting here that it seems that some tests are creating some files, and then leaving them behind at the end of the run.

See https://bugs.debian.org/1046558

> dpkg-source: info: local changes detected, the modified files are:
>  limnoria-2023.8.10/backup/Later.db.backup.1691841585
>  limnoria-2023.8.10/backup/Later.db.backup.1691841586
>  limnoria-2023.8.10/backup/Later.db.backup.1691841587
>  limnoria-2023.8.10/backup/Later.db.backup.1691841648
>  limnoria-2023.8.10/backup/PersistanceTestCase.conf.backup.1691841498
>  limnoria-2023.8.10/backup/channels.conf.backup.1691841749
>  limnoria-2023.8.10/backup/channels.conf.backup.1691841750
>  limnoria-2023.8.10/backup/channels.conf.backup.1691841751
>  limnoria-2023.8.10/backup/users.conf.backup.1691841045
>  limnoria-2023.8.10/backup/users.conf.backup.1691841051
>  limnoria-2023.8.10/backup/users.conf.backup.1691841052
>  limnoria-2023.8.10/backup/users.conf.backup.1691841676
>  limnoria-2023.8.10/limnoria.egg-info/SOURCES.txt
>  limnoria-2023.8.10/test-conf/channels.conf
>  limnoria-2023.8.10/test-logs/ChannelLogger/test/#test/#test.log
>  limnoria-2023.8.10/test-logs/messages.log
> dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/limnoria_2023.8.10-1.diff.mDG2ao

Please ignore the egg-info, as we will be taking care of that, but the other file are something that was created during build, and then at the end not cleaned up. Could you please look into this?

progval commented 1 year ago

Related: #811

progval commented 1 year ago

After applying 8029e2b3900ffc1ed0693e37bc0abcad3c71a6f6, passing the --clean option should ensure supybot-test cleans after itself. Could you check?

mapreri commented 1 year ago

Uh, honestly I wasn't even aware of the --clean option there! FWIW, I verified that indeed just adding the option didn't change anything.

That said, I tried including that commit and using --clean, but I still had one changed file:

dpkg-source: info: local changes detected, the modified files are:
 limnoria-2023.8.10/test-logs/ChannelLogger/test/#test/#test.log
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/limnoria_2023.8.10-2.diff.4TwC1Z

which is:

--- /dev/null
+++ limnoria-2023.8.10/test-logs/ChannelLogger/test/#test/#test.log
@@ -0,0 +1,13 @@
+2023-09-04T16:09:06  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:06  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:06  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:07  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:08  *** test <test!user@host.domain.tld> has joined #test
+2023-09-04T16:09:08  *** test <test!user@host.domain.tld> has joined #test
progval commented 1 year ago

Ah yes my bad, --clean removes files before running tests, not after

progval commented 1 year ago

Is it possible for you to rm them from your own test script, or change the CWD to /tmp before running supybot-test?

mapreri commented 1 year ago

I can do either of that for sure, but it would imho be more appropriate if this cleanup was covered by the upstream build system. Also now there is only one file left...

On Mon, 4 Sept 2023, 9:57 pm Val Lorentz, @.***> wrote:

Is it possible for you to rm them from your own test script, or change the CWD to /tmp before running supybot-test?

— Reply to this email directly, view it on GitHub https://github.com/progval/Limnoria/issues/1553#issuecomment-1705513942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL7FE5N755VCUFDAQJZFNDXYX6QRANCNFSM6AAAAAA4KGUANU . You are receiving this because you authored the thread.Message ID: @.***>

progval commented 1 year ago

I'll think about it

Also now there is only one file left...

I partially reverted my fix because it disabled the main log (test-logs/messages.log) entirely during tests which is undesirable; and the test-conf/ directory is still as present as before.

progval commented 1 year ago

c337684b01978b8b8ed5ef0940f5e8d3b05753f6 should do it

progval commented 1 year ago

oops, f8dd8d764264ec3c0ef69555e438a2d1c0024ea0

mapreri commented 1 year ago

Alright, with this indeed I can build twice correctly, thank you! ♥

mapreri commented 6 months ago

closing as this is fixed for me!