Skip to content
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

Merged
merged 4 commits into from
Feb 17, 2016

Conversation

okurz
Copy link
Member

@okurz okurz commented Feb 10, 2016

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:
screenshot_20160210_142024

  • test results: Add failure details to previous jobs
  • Also use direct reference to db in "sub show"
  • test results: Add tab with "previous results" in same scenario
  • templates: test: Reload selected tab also when no modlist

Tested against production database dump from openqa.opensuse.org, querying with

time sudo -u geekotest OPENQA_CONFIG=local/stage OPENQA_DATABASE=stage script/openqa get '/tests/117629' >/dev/null 2>&1 | grep real

yields the following time increase before and after change

  • origin/master: 0.8s
  • feature/label_and_previous_results: 1.1s

@okurz okurz force-pushed the feature/label_and_previous_results branch 2 times, most recently from 3a79826 to c0e258d Compare February 10, 2016 15:46
@@ -293,6 +293,33 @@ sub _job_get($) {
return $job->to_hash(assets => 1);
}

sub job_settings_subquery {
Copy link
Contributor

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.

@coolo
Copy link
Contributor

coolo commented Feb 11, 2016

please also rebase, so the diff is a bit smaller

@@ -0,0 +1,7 @@
% if ($comments and $comments > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're cheating :)

Copy link
Member Author

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.

Copy link
Contributor

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)?

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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?

Copy link
Contributor

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) ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @coolo said. L26 clearly set scalar as $comments.

@coolo
Copy link
Contributor

coolo commented Feb 11, 2016

BTW: I would be curious how this behaves on a production copy data

@okurz
Copy link
Member Author

okurz commented Feb 11, 2016

BTW: I would be curious how this behaves on a production copy data

yes, plan for today

@okurz okurz force-pushed the feature/label_and_previous_results branch 2 times, most recently from 73c7d55 to 101653a Compare February 16, 2016 17:29
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.
@okurz okurz force-pushed the feature/label_and_previous_results branch from 101653a to a7c1228 Compare February 16, 2016 17:29
@okurz
Copy link
Member Author

okurz commented Feb 16, 2016

updated:

  • performance test with production database dump (see description)
  • rebased (now also showing labels on previous results)
  • javascript adjustment on results page: Reload selected tab also when no modlist

updated screenshot:
openqa_previous_results_with_labels

@coolo, @sysrich ping

coolo added a commit that referenced this pull request Feb 17, 2016
Show previous results in test results page
@coolo coolo merged commit 8da815f into os-autoinst:master Feb 17, 2016
@Soulofdestiny
Copy link
Contributor

If a test with the same name ran on different machines (e.g. "allpatterns" and "allpatterns@zkvm", it founds multiple previous jobs
intentional or bug?

screenshot from 2016-03-01 15-43-36

@sysrich
Copy link
Member

sysrich commented Mar 1, 2016

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 :)

@okurz okurz deleted the feature/label_and_previous_results branch March 1, 2016 15:47
@okurz
Copy link
Member Author

okurz commented Mar 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants