Project

General

Profile

Actions

action #113510

closed

coordination #103323: [epic] BCI testing

Make soft-failures from XFAIL tests from BCI-tests results

Added by jlausuch almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
2022-07-12
Due date:
% Done:

0%

Estimated time:

Description

in BCI-tests there is the option to mark some tests as XFAIL with a bug ref, which is basically the same as we have in openQA soft-fail.
For example:
https://github.com/SUSE/BCI-tests/blob/d1025351849e293dfc2992b87ce43f079c998dd2/tests/test_openjdk_devel.py#L28

 pytest.mark.xfail(
                reason="https://bugzilla.suse.com/show_bug.cgi?id=1199262"
            )

Those results will be taken by openQA as working test.

The goal of this ticket is to mark the openQA job as soft-failure if there is some XFAIL when running BCI-test.

Actions #1

Updated by mdati almost 2 years ago

Test cases examples:

Actions #2

Updated by ilausuch almost 2 years ago

In java we have XFAILs too

Actions #3

Updated by jlausuch almost 2 years ago

  • Priority changed from Normal to High
Actions #4

Updated by slo-gin almost 2 years ago

This ticket was set to High priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #5

Updated by mdati almost 2 years ago

  • Assignee set to mdati

Checking

Actions #6

Updated by mdati almost 2 years ago

  • Status changed from Workable to In Progress
Actions #7

Updated by mdati almost 2 years ago

The BCI tests are written in python and tested with 'pytest' using 'tox'. The openqa container tests start with the Perl module bci_test.pm that run in a bash session the tox command composed with proper parameters based on the test settings.

The pytest exit codes are 5 specific values but where xfail occurrence is not visible, that is i.e., if only xfail occurr in the test execution, we have no evidence of it and zero is returned as all pass.

Therefore the simplest way to detect xfail in the openqa bci_test.pm module seems to be,after tox ran with the pytest '-rxX' option added, to execute a pytest logs inspection searching for XFAIL string and manage the result in the Perl module, in order to assign a Soft Failure.

So, to verify the validity of this method, I am cloning some tests using a temporary modifyed branch of the BCI test with additional XFAIL tests in test_all.py, that should appear in the log and proof that behaviour.

Actions #8

Updated by mdati almost 2 years ago

After the BCI test code updated, the proof cloning some tests of the Containers/BCI Base Images 15-SP3 group are ok and report Soft Failure where XFAIL is present.

But depending on the test function input parameters, if needed to select all the xfail also where the MARKER is missing,it could be useful to add to the MARKER parameter an "or" expression, like:
BCI_IMAGE_MARKER = $BCI_IMAGE_MARKER + " or XFAIL" .

I.e.: BCI_IMAGE_MARKER="bci/bci-init_15.3 or XFAIL"

In this way the pytest -k filter will also select all the tests resulting XFAIL.

Actions #9

Updated by mdati almost 2 years ago

  • Status changed from In Progress to Feedback

PR 15532 Merged into master

Actions #10

Updated by slo-gin over 1 year ago

This ticket was set to High priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #11

Updated by mdati over 1 year ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF