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

basetest: Fix force_soft_fail being able to override the module status #1062

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions basetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ sub done {
autotest::set_current_test(undef);
}

sub fail_if_running {
my $self = shift;
$self->{result} = 'fail' if $self->{result};
autotest::set_current_test(undef);
}

sub skip_if_not_running {
my ($self) = @_;

Expand Down Expand Up @@ -323,7 +317,6 @@ sub run_post_fail {
eval { $self->post_fail_hook; };
bmwqemu::diag("post_fail_hook failed: $@") if $@;
$self->{post_fail_hook_running} = 0;
$self->fail_if_running();
die $msg . "\n";
}

Expand Down Expand Up @@ -366,7 +359,7 @@ sub runtest {

# Detect serial failures and override result if die
eval { $self->search_for_expected_serial_failures(); };
# Process serial dectection failure
# Process serial detection failure
if ($@) {
bmwqemu::diag($@);
$self->record_resultfile('Failed', $@, result => 'fail');
Expand Down
1 change: 1 addition & 0 deletions t/data/tests/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ unless (get_var('INTEGRATION_TESTS')) {
autotest::loadtest "tests/assert_screen_fail_test.pm";
autotest::loadtest "tests/typing.pm";
autotest::loadtest "tests/reload_needles.pm";
autotest::loadtest "tests/force_soft_failure.pm";
autotest::loadtest "tests/modify_and_upload_file.pm";
}
autotest::loadtest "tests/shutdown.pm";
Expand Down
7 changes: 4 additions & 3 deletions testapi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ sub record_info {

force_soft_failure([$reason]);

Like C<record_soft_failure> but overrides the test module status to a softfail
status even if the module would be set to fail otherwise. This can be used for
easier tracking of known issues without needing to handle failed tests a lot.
Similar to C<record_soft_failure> but can be used to override the test module
status to softfail from a C<post_fail_hook> if the module would be set to fail
otherwise. This can be used for easier tracking of known issues without
needing to handle failed tests a lot.

=cut

Expand Down