From 7505d8c85e31af279d9ef3fdebb73b0a574c237c Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Tue, 10 Apr 2018 15:27:50 +0200 Subject: [PATCH 1/3] Parse run output of implicit RFC testrun and display it instead of raw socket messages --- app/views/request_for_comments/show.html.erb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index d3751d0b..bfc117fa 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -46,7 +46,17 @@
<% output_runs.each do |testrun| %> -
<%= testrun.try(:output) or t('request_for_comments.no_output') %>
+ <% + output = testrun.try(:output) + if output + messages = output.scan(/{(?:(?:".+?":".+?")+?,?)+}/) + messages.map! {|el| JSON.parse(el)} + messages.keep_if {|message| message['cmd'] == 'write'} + messages.map! {|message| message['data']} + output = messages.join '' + end + %> +
<%= output or t('request_for_comments.no_output') %>
<% end %>
<% end %> From fc614ce4acc96c808987ae7ebf12e765b8e12d1b Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Tue, 10 Apr 2018 15:31:23 +0200 Subject: [PATCH 2/3] Hide run output by default --- app/views/request_for_comments/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index bfc117fa..e4e83147 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -43,8 +43,8 @@ <% output_runs = testruns.select { |run| run.cause == 'run' } %> <% if output_runs.size > 0 %>
<%= t('request_for_comments.runtime_output') %>
-
- +