From: Michael Opdenacker <michael.opdenacker@bootlin.com>
To: Joshua Watt <jpewhacker@gmail.com>
Cc: bitbake-devel@lists.openembedded.org,
Tim Orling <ticotimo@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v5 5/5] prserv: add bitbake selftests
Date: Tue, 30 Apr 2024 10:29:23 +0200 [thread overview]
Message-ID: <9f60ce91-fccb-45fc-8564-1194802bb805@bootlin.com> (raw)
In-Reply-To: <CAJdd5GZd-UQ6uQh3m__fU21KGOcMvQbt93zeR2S33DOxi02f3Q@mail.gmail.com>
Hi Joshua
Many thanks for the review!
On 4/29/24 at 23:08, Joshua Watt wrote:
>> +
>> +class PRBasicTests(PRTestSetup, unittest.TestCase):
>> +
>> + def setUp(self):
>> + dbfile = "prtest-basic.sqlite3"
> It's generally considered bad form to dump test files in the users CWD
> and also blindly os.remove() things there :)
>
> In the hash server tests, we create a temporary directory and clean it
> up when the test ends by doing this in setUp():
>
> self.temp_dir = tempfile.TemporaryDirectory(prefix='bb-hashserv')
> self.addCleanup(self.temp_dir.cleanup)
>
> Then use self.temp_dir as the base whenever you need a path, e.g:
>
> dbfile = os.path.join(self.temp_dir, "prtest-basic.sqlite3")
Done! Good catch.
I remember now keeping the database files when I was implementing the
tests so that I could inspect the databases manually.
At least with this approach, I don't have to remove the database file if
it exists! This almost makes the code smaller :)
This will be included in my next branch update.
Thanks!
Michael.
--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2024-04-30 8:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 20:14 [PATCH v5 0/5] prserv: add support for an "upstream" server michael.opdenacker
2024-04-29 20:14 ` [PATCH v5 1/5] prserv: declare "max_package_pr" client hook michael.opdenacker
2024-04-29 20:14 ` [PATCH v5 2/5] prserv: move code from __init__ to bitbake-prserv michael.opdenacker
2024-05-02 16:57 ` [bitbake-devel] " Khem Raj
2024-05-03 8:04 ` Michael Opdenacker
2024-05-03 14:14 ` Khem Raj
2024-05-08 13:35 ` Richard Purdie
2024-05-08 15:13 ` Khem Raj
2024-05-08 17:40 ` Michael Opdenacker
2024-05-14 17:03 ` Khem Raj
2024-04-29 20:14 ` [PATCH v5 3/5] prserv: add "upstream" server support michael.opdenacker
2024-04-29 20:14 ` [PATCH v5 4/5] prserv: enable database sharing michael.opdenacker
2024-04-29 20:34 ` Joshua Watt
2024-04-30 12:58 ` Michael Opdenacker
2024-04-30 13:23 ` Joshua Watt
2024-04-30 13:55 ` Joshua Watt
2024-04-30 14:38 ` Michael Opdenacker
2024-04-29 20:14 ` [PATCH v5 5/5] prserv: add bitbake selftests michael.opdenacker
2024-04-29 21:08 ` Joshua Watt
2024-04-30 8:29 ` Michael Opdenacker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f60ce91-fccb-45fc-8564-1194802bb805@bootlin.com \
--to=michael.opdenacker@bootlin.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=jpewhacker@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ticotimo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.