qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: "Lukáš Doktor" <ldoktor@redhat.com>,
	"Amador Pahim" <apahim@redhat.com>,
	qemu-devel@nongnu.org, "Cleber Rosa" <cleber@redhat.com>
Subject: Re: [Qemu-devel] Improving QMP test coverage
Date: Fri, 21 Jul 2017 12:16:30 -0400	[thread overview]
Message-ID: <026a093f-1f79-4af9-a5c9-d540342b472e@redhat.com> (raw)
In-Reply-To: <20170721153331.GL18014@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2606 bytes --]


On 07/21/2017 11:33 AM, Stefan Hajnoczi wrote:
>> Output testing style delegates checking ouput to diff.  I rather like it
>> when text output is readily available.  It is when testing QMP.  A
>> non-trivial example using this style could be useful, as discussing
>> ideas tends to be more productive when they come with patches.
> 
> Yes, I was considering how many of the Python iotests could be rewritten
> comfortably in shell.  It is nice when the test simply executes commands
> and the output file shows the entire history of what happened.  Great
> for debugging.
> 
> Stefan
> 
I'd like to have a better understanding of the major pain points here.

Although this can be seen as a matter of taste, style preferences and
even religion, I guess it's safe to say that Python can scale better
than shell.  The upside of shell based tests is the "automatic" and
complete logging, right?  Running "bash -x /path/to/test.sh" will give
much more *useful* information than "python -v /path/to/test.py" will, fact.

I believe this has to do with how *generic* Python code is written, and
how builtin functions and most of the standard Python libraries work as
they do.  Now, when writing code aimed at testing, making use of testing
oriented libraries and tools, one would expect much more useful and
readily available debug information.

I'm biased, for sure, but that's what you get when you write basic tests
using the Avocado libraries.  For instance, when using process.run()[1]
within a test, you can choose to see its command output quite easily
with a command such as "avocado --show=avocado.test.stdout run test.py".

Using other custom logging channels is also trivial (for instance for
specific QMP communication)[2][3].

I wonder if such logging capabilities fill in the gap of what you
describe as "[when the] output file shows the entire history of what
happened".

BTW, I'll defer the discussion of using an external tool to check the
output and determine test success/failure, because it is IMO a
complementary topic, and I believe I understand its use cases.

Regards,
- Cleber.

[1] -
http://avocado-framework.readthedocs.io/en/52.0/api/utils/avocado.utils.html#avocado.utils.process.run
[2] -
http://avocado-framework.readthedocs.io/en/52.0/WritingTests.html#advanced-logging-capabilities
[3] - https://www.youtube.com/watch?v=htUbOsh8MZI

-- 
Cleber Rosa
[ Sr Software Engineer - Virtualization Team - Red Hat ]
[ Avocado Test Framework - avocado-framework.github.io ]
[  7ABB 96EB 8B46 B94D 5E0F  E9BB 657E 8D33 A5F2 09F3  ]


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-07-21 16:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 15:28 [Qemu-devel] Improving QMP test coverage Markus Armbruster
2017-07-17 10:33 ` Stefan Hajnoczi
2017-07-18 16:24   ` Markus Armbruster
2017-07-21 15:33     ` Stefan Hajnoczi
2017-07-21 16:16       ` Cleber Rosa [this message]
2017-07-24  6:56         ` Markus Armbruster
2017-07-26  1:21           ` Cleber Rosa
2017-07-27  8:14             ` Markus Armbruster
2017-07-27  9:19               ` Fam Zheng
2017-07-27  9:58                 ` Fam Zheng
2017-07-27 10:09                 ` Daniel P. Berrange
2017-07-27 11:16                   ` Fam Zheng
2017-08-01 10:25                     ` Stefan Hajnoczi
2017-07-27 10:04           ` Daniel P. Berrange

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=026a093f-1f79-4af9-a5c9-d540342b472e@redhat.com \
    --to=crosa@redhat.com \
    --cc=apahim@redhat.com \
    --cc=armbru@redhat.com \
    --cc=cleber@redhat.com \
    --cc=ldoktor@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).