-
Notifications
You must be signed in to change notification settings - Fork 269
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
New tests and changes to handle YaST's new libstorage #3409
Conversation
partitioning_guided.pm
Outdated
# SUSE's openQA tests | ||
# | ||
# Copyright © 2009-2013 Bernhard M. Wiedemann | ||
# Copyright © 2012-2016 SUSE LLC |
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.
Please only use current year
partitioning_guided.pm
Outdated
# without any warranty. | ||
|
||
# Summary: Use guided partitioning setup to delete an existing windows partition. | ||
# Maintainer: cwh |
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.
Can you use an email instead?
partitioning_guided.pm
Outdated
|
||
|
||
use warnings; | ||
use parent qw(y2logsstep); |
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.
Please use single ticks for single value imports
partitioning_guided.pm
Outdated
# Enter guided setup | ||
send_key "alt-g"; | ||
|
||
assert_screen('inst-partition-guided', 10); |
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.
Just assert_screen
with default timeout should be fine
partitioning_guided.pm
Outdated
} | ||
|
||
sub run() { | ||
my $self = shift; |
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.
Just delete if you don't use it
assert_screen "inst-overview-booting"; | ||
|
||
# preserve it for the video | ||
wait_idle 10; |
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.
delete
# without any warranty. | ||
# | ||
# | ||
# Summary: |
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 not a very convincing summary ;-)
assert_and_click 'hard-disks'; | ||
assert_and_click 'home'; | ||
|
||
send_key 'alt-d'; # Delete |
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 this might fail because the next keypress might get lost. Better guard it with wait_screen_change
-> wait_screen_change { send_key 'alt-d' };
save_screenshot; | ||
|
||
send_key $cmd{accept}; | ||
die "/home still there" if check_screen('home'); |
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.
Please don't use check_screen with default timeout. Either surround the previous send_key
with wait_screen_change
or use a multi-tag assert_screen plus match_has_tag
my $numdisks = get_var("NUMDISKS"); | ||
print "NUMDISKS = $numdisks\n"; | ||
|
||
check_screen([qw(inst-partition-radio-buttons inst-partition-guided inst-partitioning-scheme)], 10); |
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.
Please don't use check_screen with timeout other than 0. Either surround the previous send_key
with wait_screen_change
or use a multi-tag assert_screen plus match_has_tag
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 just extended the existing code, here. So that check_screen …, 10;
already was there, before.
Maybe it is worth rewriting the old code anyway?
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.
yes
Delete dot at end-of-line of commit message subject lines and PR messages |
@@ -32,6 +32,21 @@ sub run { | |||
assert_screen "inst-xen-pattern"; | |||
} | |||
|
|||
# preserve it for the video | |||
wait_idle 10; |
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 can use wait_still_screen instead.
elsif (get_var("STORAGE_NG")) { | ||
if ($numdisks <= 1) { | ||
die "Guided workflow does not skip disk selection when only one disk!" | ||
if !match_has_tag('inst-partitioning-scheme'); |
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.
Matter of taste, but it's more wordy to use "unless" here and get rid of negation
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.
For my personal taste actually an "if not" is more obvious than a "unless" – but if ther is any convention about this, I will of course change it.
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.
Nope, that's why I say that it's matter of taste, so no change is really required. Only point that negated expressions usually are evaluated a little slower, but probably unless does it anyway underneath.
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.
just use "unless" :-)
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.
Acually, when reading Damian Conway's "Perl Best Practices" I learned, that using negative modifiers like unless
and until
should be avoided as much as possible. See #13 in http://www.perlmonks.org/?node_id=989115
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.
It's all subjective, but I totally agree with subpoints: Use unless and until only with positive statements so you don't create a double negative logic, which would be twice as confusing! Never follow an unless block with an else block.
If it's used in that way that you can read it in plain English, like "die unless" it's more wordy than "die if not", which is totally perlish and is confusing for some people. I'm fine if we are just consistent, so I do not request a change here. And thanks for the link, it's nice article!
} | ||
else { | ||
die "Guided workflow does skip disk selection when more than one disk! (NUMDISKS=$numdisks)" | ||
if !match_has_tag('inst-partition-guided'); |
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.
Same as above.
|
||
if (!get_var('ENCRYPT_ACTIVATE_EXISTING')) { | ||
assert_screen 'inst-encrypt-password-prompt'; | ||
#send_key 'tab'; # might be needed again later |
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.
Probably we can remove this one
#send_key 'tab'; # might be needed again later | ||
type_password; | ||
send_key 'tab'; | ||
type_password; |
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.
Here is a little tricky part, as what we have seen sometimes that we press keys to fast and for example start typing password before we got into password field. But let's see if we experience this issue.
Integrated your proposed changes |
tests/installation/grub_test.pm
Outdated
|
||
if (get_var("STORAGE_NG") && get_var("ENCRYPT")) { | ||
my @tags = (); | ||
for ( my $disk = 0; $disk < get_var("NUMDISKS", 1); $disk++ ) { |
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.
Travis complains about spaces after and before brackets.
3909015
to
a658f87
Compare
The setup of perlcritic here in travis is different than when run locally on my and Rodion's machine. |
On Wednesday, 16 August 2017 08:14:46 CEST Christopher Hofmann wrote:
The setup of perlcritic here in travis is different than when run locally on
my and Rodion's. Also it does not tell the file, where it found the error.
So the problem here is unfixable for me. I wasted half a day of debugging
here and will be on vacation from now on. Contact my team if you want this
to be merged before week 35 when I am back.
It seems you ran perltidy locally but it failed to read the os-autoinst based
.perltidyrc
so make sure you have an existing "os-autoinst" linked into os-autoinst-
distri-opensuse or call `make prepare`
|
@okurz We did exactly this and it looks like it uses different profile. In the end main point here is that it's not clear about which file travis is complaining about, otherwise it's ok to fix results after pushing the commit. |
squashed and merged locally, approved by @rwx788 |
No description provided.