[Patchew-devel] [PATCH 3/8] rest: add data to testing results

Paolo Bonzini posted 8 patches 6 years, 7 months ago
[Patchew-devel] [PATCH 3/8] rest: add data to testing results
Posted by Paolo Bonzini 6 years, 7 months ago
---
 mods/testing.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mods/testing.py b/mods/testing.py
index 52407b7..cf22004 100644
--- a/mods/testing.py
+++ b/mods/testing.py
@@ -284,8 +284,11 @@ class TestingModule(PatchewModule):
             failed = not p["passed"]
             log_url = self.reverse_testing_log(message, tn, request=request, html=False)
             passed_str = "failure" if failed else "success"
+
+            data = p.copy()
+            del data['passed']
             results.append(Result(name='testing.' + tn, status=passed_str, log_url=log_url,
-                                  request=request))
+                                  request=request, data=data))
 
     def prepare_message_hook(self, request, message, detailed):
         if not message.is_series_head:
-- 
2.16.2


_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
Re: [Patchew-devel] [PATCH 3/8] rest: add data to testing results
Posted by Fam Zheng 6 years, 6 months ago
On Sat, 03/24 14:37, Paolo Bonzini wrote:
> ---
>  mods/testing.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/mods/testing.py b/mods/testing.py
> index 52407b7..cf22004 100644
> --- a/mods/testing.py
> +++ b/mods/testing.py
> @@ -284,8 +284,11 @@ class TestingModule(PatchewModule):
>              failed = not p["passed"]
>              log_url = self.reverse_testing_log(message, tn, request=request, html=False)
>              passed_str = "failure" if failed else "success"
> +
> +            data = p.copy()
> +            del data['passed']

Why the del here?

Fam

>              results.append(Result(name='testing.' + tn, status=passed_str, log_url=log_url,
> -                                  request=request))
> +                                  request=request, data=data))
>  
>      def prepare_message_hook(self, request, message, detailed):
>          if not message.is_series_head:
> -- 
> 2.16.2
> 
> 
> _______________________________________________
> Patchew-devel mailing list
> Patchew-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/patchew-devel

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
Re: [Patchew-devel] [PATCH 3/8] rest: add data to testing results
Posted by Paolo Bonzini 6 years, 6 months ago
On 30/03/2018 04:59, Fam Zheng wrote:
> On Sat, 03/24 14:37, Paolo Bonzini wrote:
>> ---
>>  mods/testing.py | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/mods/testing.py b/mods/testing.py
>> index 52407b7..cf22004 100644
>> --- a/mods/testing.py
>> +++ b/mods/testing.py
>> @@ -284,8 +284,11 @@ class TestingModule(PatchewModule):
>>              failed = not p["passed"]
>>              log_url = self.reverse_testing_log(message, tn, request=request, html=False)
>>              passed_str = "failure" if failed else "success"
>> +
>> +            data = p.copy()
>> +            del data['passed']
> 
> Why the del here?

Because "passed" is already part of the "status" field.  It need not be
in the data dictionary.

Paolo

> Fam
> 
>>              results.append(Result(name='testing.' + tn, status=passed_str, log_url=log_url,
>> -                                  request=request))
>> +                                  request=request, data=data))
>>  
>>      def prepare_message_hook(self, request, message, detailed):
>>          if not message.is_series_head:
>> -- 
>> 2.16.2
>>
>>
>> _______________________________________________
>> Patchew-devel mailing list
>> Patchew-devel@redhat.com
>> https://www.redhat.com/mailman/listinfo/patchew-devel

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel