-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show previous results in test results page #538
Show previous results in test results page #538
Conversation
3a79826
to
c0e258d
Compare
@@ -293,6 +293,33 @@ sub _job_get($) { | |||
return $job->to_hash(assets => 1); | |||
} | |||
|
|||
sub job_settings_subquery { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the memo was sent before you joined - but we declared Scheduler.pm as dead. Code should be removed from it, not added. So please put this code into the model.
please also rebase, so the diff is a bit smaller |
@@ -0,0 +1,7 @@ | |||
% if ($comments and $comments > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're cheating :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, I don't want to. I commented on this in the corresponding commit message:
okurz@c0e258d
The 'if ($comment and $comments > 0)' is used to prevent warnings about
undefined if comments are not available at all but also not show notifications
if it is always defined by 0 as used in 'previous.html.ep'.
Don't know a better way except for needing to count the available comments within Jobs.pm#show like in sub overview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, there are $comment
and $comments
. Just spent 5min staring at this :) . What about if ($comment and defined $comments)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code comment talks about $comment , the code does not - it's $comments only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. So what is the issue with plain if ($comments)
again? Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code section is included in two locations, templates/test/previous.html.ep with the resultset including comments as parameter (always defined but can be empty) and templates/test/tr_job_result.html.ep with $res->{comments} as parameter which is a scalar (undef if no comments).
If I just check with if ($comments)
then it will always be true for "previous.html" and always display the symbol. If I just check with if ($comments > 0)
then it will yield a warning for "tr_job_result.html".
So what approach do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previous sets $comments to the number of comments, right? if ($comments) will be false if that number is 0. So where is the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ that's the difference between if ($comments) and if (defined $comments) ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW: I would be curious how this behaves on a production copy data |
yes, plan for today |
73c7d55
to
101653a
Compare
Querying the database for former test runs of the same scenario is a rather costly operation which we do not want to do for multiple test results at once but only for each individual test result (1:1 relation). Related issue: https://progress.opensuse.org/issues/10212
Extract helper templates from overview template and reuse them in failure details on previous jobs in test results page.
101653a
to
a7c1228
Compare
Show previous results in test results page
I think it's a bug, but it's an awesome one ;) @okurz please change the filter so the previous jobs filter based on machine used by the job, not arch :) |
tracked in https://progress.opensuse.org/issues/11034 |
Querying the database for former test runs of the same scenario is a rather
costly operation which we do not want to do for multiple test results at once
but only for each individual test result (1:1 relation).
Related issue: https://progress.opensuse.org/issues/10212
Screenshot of feature:
Tested against production database dump from openqa.opensuse.org, querying with
yields the following time increase before and after change