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

Proper encoding of skipped AUNIT tests into junit results xml #101

Closed
mnezerka opened this issue Feb 28, 2023 · 0 comments · Fixed by #102
Closed

Proper encoding of skipped AUNIT tests into junit results xml #101

mnezerka opened this issue Feb 28, 2023 · 0 comments · Fixed by #102

Comments

@mnezerka
Copy link
Collaborator

The current implementation encodes skipped tests as:

<testcase classname="net.cars.engine.ValveTest" name="moveDown" status="SKIP">
  <system-err>Test execution skipped due to missing prerequisites in car engine</system-err>
  <error type="abortion" message="Missing Prerequisites - Skipped due to potential obsolete</error>
</testcase>

It would be great to align with aunit schema/standard:

<testcase classname="net.cars.engine.ValveTest" name="moveDown">
    <skipped />
</testcase>

or with message:

<testcase classname="net.cars.engine.ValveTest" name="moveDown">
    <skipped message="Test execution skipped due to missing prerequisites in car engine"/>
</testcase>

More details regarding junit format:
https://llg.cubic.org/docs/junit/

The relevant piece of the sapcli code seems to be here:
https://github.com/jfilak/sapcli/blob/master/sap/cli/aunit.py#L275

@mnezerka mnezerka changed the title Proper encoding of skipped tests into junit results xml Proper encoding of skipped AUNIT tests into junit results xml Feb 28, 2023
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ).

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ) which sets the attributes this way.

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ) which sets the attributes this way.

To be defensive: I would rather receive a complain that we do not
recognize skipped test than that we missed a real error and incorrectly
marked it as skipped.

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ) which sets the attributes this way.

To be defensive: I would rather receive a complain that we do not
recognize skipped test than that we missed a real error and incorrectly
marked it as skipped.

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ) which sets the attributes this way.

To be defensive: I would rather receive a complain that we do not
recognize skipped test than that we missed a real error and incorrectly
marked it as skipped.

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
jfilak added a commit that referenced this issue Feb 28, 2023
I was not sure how to convert ABAP ADT AUnit XML into JUnit.

I have decided to consider skipped only the tests with the kind ABORTION
and the severity TOLERABLE - I consulted ABAP code of
cl_abap_unit_assert=>skip( ) which sets the attributes this way.

To be defensive: I would rather receive a complain that we do not
recognize skipped test than that we missed a real error and incorrectly
marked it as skipped.

Jenkins output:

    DO_THE_FAIL – ZCL_THEKING_MANUAL_HARDCORE=>LTCL_TEST

    Standard Output:
    Include: <ZCL_THEKING_MANUAL_HARDCORE===CCAU> Line: <19> (DO_THE_FAIL)

    Standard Error:
    Test execution skipped due to missing prerequisites
    Test 'LTCL_TEST->DO_THE_FAIL' in Main Program 'ZCL_THEKING_MANUAL_HARDCORE===CP'.

Closes #101
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 a pull request may close this issue.

1 participant