public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner/resultgen: Handle empty outputs
@ 2019-10-11 11:52 Petri Latvala
  2019-10-11 12:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Petri Latvala @ 2019-10-11 11:52 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If an output (out.txt or err.txt) is completely empty, we handle the
parsing just fine as is, but we end up assuming that if journal says
we have a subtest, that subtest printed that it started. We have one
case where out.txt was empty and all other files were intact (ran out
of disk?)

All other paths that expect certain texts handle failures finding them
properly apart from subtest result processing, which happily passed
along a NULL pointer as a string to json. After handling that case,
the processing of said weird case proceeded fine and produced correct
results.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 runner/resultgen.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/runner/resultgen.c b/runner/resultgen.c
index 58b95220..46c9d8d5 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -268,8 +268,9 @@ static struct json_object *get_or_create_json_object(struct json_object *base,
 
 static void set_result(struct json_object *obj, const char *result)
 {
-	json_object_object_add(obj, "result",
-			       json_object_new_string(result));
+	if (result)
+		json_object_object_add(obj, "result",
+				       json_object_new_string(result));
 }
 
 static void add_runtime(struct json_object *obj, double time)
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-10-11 18:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-11 11:52 [igt-dev] [PATCH i-g-t] runner/resultgen: Handle empty outputs Petri Latvala
2019-10-11 12:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2019-10-11 12:26 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2019-10-11 13:00 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-10-11 18:27 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox