All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] autobuild-run: store summary if not uploading
@ 2019-01-15 21:37 Arnout Vandecappelle
  2019-08-03 19:48 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Arnout Vandecappelle @ 2019-01-15 21:37 UTC (permalink / raw)
  To: buildroot

When using autobuild-run for testing local changes, the results will not
be uploaded. However, the tarballs are very inconvenient for processing
the results (which is obviously needed for testing local changes).

Setting up a database to store build results like on a.b.o is overkill
for most cases. Collecting all results in a single file is also a little
bit complicated, since it would have to be protected against concurrent
updates from the different instances. Therefore, simply create a
"summary" file in addition to the results tarball.

The summary file contains only the information that is readily available
already: result and reason. Submitter is not relevant for the local
testing use case. arch, libc and static are extracted by the a.b.o PHP
scripts so they are not readily available, so they are not included. If
such information is needed for some use case, it is probably better to
set up a local instance of the a.b.o server and database anyway.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 scripts/autobuild-run | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 77272f5..c3b51bc 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -617,6 +617,10 @@ def send_results(result, **kwargs):
             sha1 = hashlib.sha1(f.read()).hexdigest()
         resultfilename = "instance-%d-%s.tar.bz2" % (kwargs['instance'], sha1)
         os.rename(os.path.join(outputdir, "results.tar.bz2"), resultfilename)
+        summaryfilename = "instance-%d-%s.summary" % (kwargs['instance'], sha1)
+        reason = get_failure_reason() or ("",)
+        with open(summaryfilename, 'wt') as f:
+            f.write("%d,%s\n" % (result, ','.join(reason)))
         log_write(log, "INFO: results saved as %s" % resultfilename)
 
 def run_instance(**kwargs):
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] autobuild-run: store summary if not uploading
  2019-01-15 21:37 [Buildroot] [PATCH] autobuild-run: store summary if not uploading Arnout Vandecappelle
@ 2019-08-03 19:48 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2019-08-03 19:48 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 15 Jan 2019 22:37:24 +0100
"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> wrote:

> diff --git a/scripts/autobuild-run b/scripts/autobuild-run
> index 77272f5..c3b51bc 100755
> --- a/scripts/autobuild-run
> +++ b/scripts/autobuild-run
> @@ -617,6 +617,10 @@ def send_results(result, **kwargs):
>              sha1 = hashlib.sha1(f.read()).hexdigest()
>          resultfilename = "instance-%d-%s.tar.bz2" % (kwargs['instance'], sha1)
>          os.rename(os.path.join(outputdir, "results.tar.bz2"), resultfilename)
> +        summaryfilename = "instance-%d-%s.summary" % (kwargs['instance'], sha1)
> +        reason = get_failure_reason() or ("",)
> +        with open(summaryfilename, 'wt') as f:
> +            f.write("%d,%s\n" % (result, ','.join(reason)))

The code changed a bit around this (kwargs has been replaced by class
members, the reason is already in a "reason" variable, so no need to
call get_failure_reason() again, etc.). I fixed this up, and applied.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-03 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 21:37 [Buildroot] [PATCH] autobuild-run: store summary if not uploading Arnout Vandecappelle
2019-08-03 19:48 ` Thomas Petazzoni

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.