[patchew-devel] [RFC PATCH 0/6] filters for email templates

Paolo Bonzini posted 6 patches 6 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/20180305091634.7391-1-pbonzini@redhat.com
mods/testing.py           |  54 +++++-----
patchew/logviewer.py      | 252 ++++++++++++++++++++++++++++------------------
patchew/settings.py       |   3 +
patchew/tags.py           |  96 ++++++++++++++++++
tests/test_ansi2html.py   |  75 +++++++++++++-
tests/test_custom_tags.py | 129 ++++++++++++++++++++++++
6 files changed, 485 insertions(+), 124 deletions(-)
create mode 100644 patchew/tags.py
create mode 100755 tests/test_custom_tags.py
[patchew-devel] [RFC PATCH 0/6] filters for email templates
Posted by Paolo Bonzini 6 years, 1 month ago
These patches add template tags and filters designed for use in email sent
by Patchew: convert ANSI to text, and grep with context.

Not very much tested. :)

Paolo Bonzini (6):
  ansi2html: add _write_form_feed
  ansi2html: create ANSIProcessor superclass
  ansi2html: create ANSI to text converter
  add custom template tags for manipulating testing logs
  testing: add reverse_testing_log
  testing: pass log URL in the TestingReport event

 mods/testing.py           |  54 +++++-----
 patchew/logviewer.py      | 252 ++++++++++++++++++++++++++++------------------
 patchew/settings.py       |   3 +
 patchew/tags.py           |  96 ++++++++++++++++++
 tests/test_ansi2html.py   |  75 +++++++++++++-
 tests/test_custom_tags.py | 129 ++++++++++++++++++++++++
 6 files changed, 485 insertions(+), 124 deletions(-)
 create mode 100644 patchew/tags.py
 create mode 100755 tests/test_custom_tags.py

-- 
2.14.3


[patchew-devel] Re: [RFC PATCH 0/6] filters for email templates
Posted by Fam Zheng 6 years, 1 month ago
On Mon, 03/05 10:16, Paolo Bonzini wrote:
> These patches add template tags and filters designed for use in email sent
> by Patchew: convert ANSI to text, and grep with context.
> 
> Not very much tested. :)

Looks good but seems tests are broken:

https://travis-ci.org/patchew-project/patchew-ci/jobs/349199479

(venv) fam@lemon:~/work/patchew [master]$ ./manage.py test tests
Loaded module: footer
Loaded module: email
Loaded module: git
Loaded module: tags
Loaded module: diff
Loaded module: testing
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
..................................................................Cannot invoke module hook: <testing.TestingModule object at 0x7fdde20f8b38>.rest_results_hook
Traceback (most recent call last):
  File "/stor/work/patchew/mod.py", line 205, in dispatch_module_hook
    getattr(i, hook_name)(**params)
  File "/stor/work/patchew/mods/testing.py", line 273, in rest_results_hook
    log_url = self.reverse_testing_log(message, tn, request=request, html=False)
NameError: name 'request' is not defined
ECannot invoke module hook: <testing.TestingModule object at 0x7fdde20f8b38>.rest_results_hook
Traceback (most recent call last):
  File "/stor/work/patchew/mod.py", line 205, in dispatch_module_hook
    getattr(i, hook_name)(**params)
  File "/stor/work/patchew/mods/testing.py", line 273, in rest_results_hook
    log_url = self.reverse_testing_log(message, tn, request=request, html=False)
NameError: name 'request' is not defined
E.............................
======================================================================
ERROR: test_rest_done_failure (test_testing.TestingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/stor/work/patchew/tests/test_testing.py", line 82, in test_rest_done_failure
    self.assertEquals(resp.data['results']['testing.tests']['status'], 'failure')
KeyError: 'testing.tests'

======================================================================
ERROR: test_rest_done_success (test_testing.TestingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/stor/work/patchew/tests/test_testing.py", line 74, in test_rest_done_success
    self.assertEquals(resp.data['results']['testing.tests']['status'], 'success')
KeyError: 'testing.tests'

----------------------------------------------------------------------
Ran 97 tests in 48.061s

FAILED (errors=2)
Destroying test database for alias 'default'...

[patchew-devel] Re: [RFC PATCH 0/6] filters for email templates
Posted by Paolo Bonzini 6 years, 1 month ago
On 06/03/2018 10:44, Fam Zheng wrote:
> On Mon, 03/05 10:16, Paolo Bonzini wrote:
>> These patches add template tags and filters designed for use in email sent
>> by Patchew: convert ANSI to text, and grep with context.
>>
>> Not very much tested. :)
> 
> Looks good but seems tests are broken:
> 
> https://travis-ci.org/patchew-project/patchew-ci/jobs/349199479

Yes, this was just a quick weekend hack to see if we could fix issue 31
easily ("Do not include the full test log in the email").  I'll send the
fixed version in a day or two.

Paolo