From: Keith Seitz <keiths@redhat.com>
To: Bunsen <bunsen@sourceware.org>
Subject: Re: [RFC PATCH] New script `summarize'
Date: Fri, 25 Sep 2020 10:02:06 -0700 [thread overview]
Message-ID: <8e8ee2f3-95ef-8009-7a8f-cb00b6f827e1@redhat.com> (raw)
In-Reply-To: <23de1a72-0feb-4937-95a3-07d185e44b02@www.fastmail.com>
On 9/25/20 8:07 AM, Serhei Makarov wrote:
>> diff --git a/bunsen.py b/bunsen.py
>> index b089d80..99c4cc0 100755
>> --- a/bunsen.py
>> +++ b/bunsen.py
>> @@ -622,6 +622,34 @@ class Testrun(dict):
>> # XXX Set summary=False if JSON was missing testcases.
>> self.summary = self.summary and 'testcases' in json_data
>>
>> + # Return properties of this Testrun as printable strings, or
> Suggest "Return configuration properties"
> for consistency with other code/comments that use the term 'configuration'
> for these properties.
Changed.
>> + # "<unknown PROPERTY>" if unknown. Returns a dictionary containing
>> + # keys for architecture, board, branch, version.
>> +
>> + def get_info_strings(self):
>> + info = dict()
>> + if 'arch' in self:
>> + info['architecture'] = self.arch
>> + else:
>> + info['architecture'] = '<unknown arch>'
>> +
>> + if 'board' in self:
>> + info['board'] = self.board
>> + else:
>> + info['board'] = '<unknown board>'
>> +
>> + if 'source_branch' in self:
>> + info['branch'] = self.source_branch
>> + else:
>> + info['branch'] = '<unknown branch>'
>> +
>> + if 'version' in self:
>> + info['version'] = self.version
>> + else:
>> + info['version'] = '<unknown version>'
>> +
>> + return info
>> +
> Looks OK to me, I may simplify or generalize this code with a later
> patch. (e.g. by taking a dictionary of field name -> display name as
> an optional argument, or having that dictionary predefined somewhere
> and defaulting to return all the keys/values that are *not* specific
> to the Bunsen storage (such as bunsen_commit_id) -- needs some
> thinking on my part, so please commit as-is for now).>
> It's worth noting that the set of configuration keys will vary by project,
> e.g. for SystemTap 'osver' (the Linux distribution) is a more important field.
>
Yes, please do whatever is necessary/efficient/clean. These are currently
the properties that I "need" in order to rule the wo^W^W^W satisfy my
use case.
I'm still getting my proverbial legs with python, so there are almost certainly
better, more pythony ways to do this, I am sure.
> LGTM.
Pushed with your suggested changes. Thank you!
Keith
prev parent reply other threads:[~2020-09-25 17:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 18:54 Keith Seitz
2020-09-25 15:07 ` Serhei Makarov
2020-09-25 17:02 ` Keith Seitz [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=8e8ee2f3-95ef-8009-7a8f-cb00b6f827e1@redhat.com \
--to=keiths@redhat.com \
--cc=bunsen@sourceware.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).