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

qa_automation: add new design for QA:HEAD tests #4132

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

cachen
Copy link
Contributor

@cachen cachen commented Dec 27, 2017

-Split test workflow into 4 steps;
-Define functions to converting ctcs2 log to junit xml;
-Define functions to upload system logs;

Use for openQA to trigger ctcs2 testsuites from QA:HEAD; I would like to keep the original setup and tests in qa_automation module for not breaking the current test; and will remove them after make sure all the reset kernel/userspace tests work well.

for example:
BOOT_HDD_IMAGE=1
DESKTOP=textmode
HDD_1=<***>.qcow2
QA_HEAD_REPO=http://dist.nue.suse.com/ibs/QA:/Head/SLE-%VERSION%
QA_TESTSUITE=fs_stress
VIRTIO_CONSOLE=0

@cachen
Copy link
Contributor Author

cachen commented Dec 27, 2017

The last PR was closed by accident during rebase...reset...! Anyway, it's great to have this clean one, I have modified base on former comments :)
I will hand over to Sero to maintain, so I gave his name as maintainer.

@ldevulder
Copy link
Member

Please use tidy --check to ensure that your code is clean :)
Or if you are in the process of developing, please add a WIP tag.

@cachen cachen force-pushed the master branch 4 times, most recently from f2daa1a to ac4e10f Compare December 28, 2017 04:50
Copy link
Member

@ldevulder ldevulder left a comment

Choose a reason for hiding this comment

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

For me, other than these few comments, looks good!

$fail_num += 1;
}
}
#my $count = $pass_nums + $fail_nums + $skip_nums;
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid code in comment, if it's not necessary why do you need to keep it? Could be useful during development but not in a PR.
At least, add a comment to explain why you need to keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, forgot to remove it.


our @EXPORT = qw(upload_system_logs);


Copy link
Member

Choose a reason for hiding this comment

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

Really a small thing, remove duplicate empty line ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For perfect, it should be removed :)


sub run {
my ($self, %args) = @_;
my $timeout = $args{timeout} || 180 * 60;
Copy link
Member

Choose a reason for hiding this comment

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

Setting default timeout to 10800 (180*60) could be too high, as the default whole timeout is lesser than that (from what I remember it's 7200).
Please consider using MAX_JOB_TIME in your test configuration instead of setting a high timeout in the code, or be sure to always set the correct timeout when your test is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

default timeout not enough for especially stress testing. 180 * 60 has verified in the current

Copy link
Member

Choose a reason for hiding this comment

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

Ok, but how 180*60 can be reached it you don't use MAX_JOB_TIME in your test configuration? As by default the global timeout is 7200 (I just verified it), so lesser than your default timeout.

Will see what another reviewer with merge access will say :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

seems that %args could never be used in the case. and i can see your prove run completed in around 1 hour.
how about to set timeout like this:
my $timeout = get_var(MAX_JOB_TIME) || value<7200

Copy link
Contributor Author

@cachen cachen Jan 2, 2018

Choose a reason for hiding this comment

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

The module will be called by a bunch of tests, each has difference time costing.
180 * 60 is to rewrite the default 7200, we have confirmed it's capability for our tests (in qa_run.pm), this time setup in here won't hurt openQA performance, and I want to avoid add too many 'var' configurations in test set :)
But @mitiao is correct, %args will never be called in this new modue, this should be removed!

Copy link
Contributor Author

@cachen cachen Jan 2, 2018

Choose a reason for hiding this comment

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

Checked test list, few need specify timeout, use MAX_JOB_TIME configuration is accepted for flexibility :)
Done!

zypper_call("--no-gpg-check ar -f $qa_head_repo qa-ibs");
if ($qa_web_repo) {
zypper_call("--no-gpg-check ar -f $qa_web_repo qa-web");
}
Copy link
Member

Choose a reason for hiding this comment

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

Just a small remark here, you could replace your if (...) { zypper_call... } by zypper_call(...) if (...); ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

easy read for Perl none expert, I would like to keep :)

Copy link
Member

Choose a reason for hiding this comment

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

I'm neither a Perl expert and I personally find the other more readable :-) And a lot of openQA test codes uses it.
But it's ok for me ;-)


# Save the output of $cmd into $file and upload it
sub system_status {
my $log = shift || "/tmp/system-status.log";
Copy link
Member

Choose a reason for hiding this comment

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

isn't first param will be always $self ? so your function will never be able to read passed param.

my ($self, $log) = @;
$log //="/tmp/system-status.log";

this should work

Copy link
Contributor Author

@cachen cachen Dec 29, 2017

Choose a reason for hiding this comment

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

it works, thanks a lot!

@cachen
Copy link
Contributor Author

cachen commented Dec 29, 2017

Thanks a lot for your review, Have updated according comments, please help to merge if no other critical issue :)

-Split test workflow into 4 steps;
-Define functions to converting ctcs2 log to junit xml;
-Define functions to upload system logs;
@mitiao mitiao merged commit 1f60588 into os-autoinst:master Jan 2, 2018
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Mar 4, 2019
os-autoinst#4132 with title
"qa_automation: add new design for QA:HEAD tests" added the use of the test
variable QA_TESTSUITE whereas qam uses QA_TESTSET only. Checked with
https://github.com/okurz/scripts/blob/master/openqa-db_query_last_use_of_module
and found no QAM job running execute_test_run.
https://openqa.suse.de/admin/test_suites shows that there are mainly QAM jobs
using QA_TESTSET however some others as well. QA_TESTSUITE is not used for
anything with a prefix like "qam". To me it looks like both are doing more or
less the equivalent except that based on QA_TESTSET shows the output of
individual test modules and also there is no module "execute_test_run" that
would fail and is hard to label.

The approach based on QA_TESTSET seems to provide much better visualization of
test results using the more recent openQA feature to show "External results".

Related progress issue: https://progress.opensuse.org/issues/44138
@pevik
Copy link
Contributor

pevik commented Jul 16, 2019

@cachen Hm, at a time, when a38f226 was merged, there was system_status() with similar functionality in tests/qa_automation/qa_run.pm. And this function is still there. It'd be nice if tests/qa_automation/qa_run.pm used lib/upload_system_log.pm.

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