[igt-dev] [PATCH] runner: fix include subtest runtimes inside json

Kira, Piotr piotr.kira at intel.com
Wed Nov 29 16:28:04 UTC 2023


From d8ed86892b20a1efbee24b67a4d07c3411d84cf9 Mon Sep 17 00:00:00 2001
From: Piotr Kira <piotr.kira at intel.com>
Date: Wed, 29 Nov 2023 17:05:16 +0100
Subject: [PATCH] runner: fix include subtest runtimes inside json

Since switching to socket communication runtimes for single subtest are
not included inside "result" json object. This patch fixes that.

Related-to: 9d889fa6b8f0
Signed-off-by: Piotr Kira <piotr.kira at intel.com>
---
 runner/resultgen.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/runner/resultgen.c b/runner/resultgen.c
index b00bb6ba5..8d5e4dfef 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -1262,6 +1262,9 @@ struct comms_context
      char *subtestresult;
      char *dynamicsubtestresult;
 
+     double subtest_execution_time;
+     double dynamic_subtest_execution_time;
+
      char *cmdline;
      int exitcode;
 
@@ -1321,6 +1324,7 @@ static void comms_finish_subtest(struct comms_context *context)
      if (context->subtestresult == NULL)
            context->subtestresult = strdup("incomplete");
      set_result(context->current_test, context->subtestresult);
+     add_runtime(context->current_test, context->subtest_execution_time);
 
      free(context->subtestresult);
      context->subtestresult = NULL;
@@ -1343,6 +1347,7 @@ static void comms_finish_dynamic_subtest(struct comms_context *context)
      if (context->dynamicsubtestresult == NULL)
            context->dynamicsubtestresult = strdup("incomplete");
      set_result(context->current_dynamic_subtest, context->dynamicsubtestresult);
+     add_runtime(context->current_dynamic_subtest, context->dynamic_subtest_execution_time);
 
      free(context->dynamicsubtestresult);
      context->dynamicsubtestresult = NULL;
@@ -1616,6 +1621,7 @@ static bool comms_handle_subtest_result(const struct runnerpacket *packet,
            parse_result_string(helper.subtestresult.result,
                            strlen(helper.subtestresult.result),
                            &mappedresult, NULL);
+           context->subtest_execution_time = strtod(helper.subtestresult.timeused, NULL);
            context->subtestresult = strdup(mappedresult);
      }
 
@@ -1757,6 +1763,7 @@ static bool comms_handle_dynamic_subtest_result(const struct runnerpacket *packe
                            strlen(helper.dynamicsubtestresult.result),
                            &mappedresult, NULL);
            context->dynamicsubtestresult = strdup(mappedresult);
+           context->dynamic_subtest_execution_time= strtod(helper.dynamicsubtestresult.timeused, NULL);
      }
 
      context->state = STATE_BETWEEN_DYNAMIC_SUBTESTS;
--
2.42.0

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


More information about the igt-dev mailing list