[Rpm-ecosystem] Testing suggestions for "dnf --quiet repolist" & dnf --quiet list"?

Radek Holy rholy at redhat.com
Tue Jul 14 09:38:00 UTC 2015



----- Original Message -----
> From: "Nick Coghlan" <ncoghlan at gmail.com>
> To: rpm-ecosystem at lists.rpm.org
> Sent: Tuesday, July 14, 2015 7:08:41 AM
> Subject: [Rpm-ecosystem] Testing suggestions for "dnf --quiet repolist" &	dnf --quiet list"?
> 
> As a way to get started on dnf development, I'm taking a look at
> https://bugzilla.redhat.com/show_bug.cgi?id=1236310
> 
> This bug points out that "dnf --quiet list" produces output, while
> "dnf --quiet repolist" does not.
> 
> The actual bug is fairly straightforward: "dnf repolist" is currently
> using "logger.info" for command output, when it should be using
> "print" (as per
> https://docs.python.org/3/howto/logging.html#when-to-use-logging)
> 
> The part I'm not clear on is how best to structure the tests for this,
> as they're really integration tests that check for unintended coupling
> between the logging configuration and the expected output of different
> commands. At the moment, there are separate unit tests for the
> individual commands, the option parsing, and the logging
> configuration, but I didn't spot any functional tests covering the
> interaction between them.
> 
> Assuming I haven't missed an existing home for such tests, would it
> perhaps be worth my while investing time in setting up some separate
> higher level behavioural tests that test the CLI itself as a black
> box, rather than testing the Python API?
> 
> Specifically, I'm thinking that behave scenarios could be a good way
> of testing some end-to-end user facing CLI behaviour for "given this
> command line, we expect this command output":
> http://pythonhosted.org/behave/tutorial.html#scenario-outlines
> 
> We wouldn't want to go overboard with these, but I think they'd be a
> good way to check the basic interconnections between components are in
> place.
> 
> Regards,
> Nick.

Hi,

I started to write some Behave tests (I'd call them "system tests" rather than "integration tests" but it doesn't matter I think) already because I wanted to make sure that my documentation of the "--installroot" switch matches the reality. Take a look at it https://github.com/rholy/dnf-extra-tests . Maybe you find it worth extending. If you do, I'm ready to move them under https://github.com/rpm-software-management/ if the rest of the team agrees.

-- 
Radek Holý
Associate Software Engineer
Software Management Team
Red Hat Czech


More information about the Rpm-ecosystem mailing list