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

fix e2e result junit format #4376

Closed
wants to merge 1 commit into from
Closed

Conversation

lilyLuLiu
Copy link
Contributor

Fixes: Issue #4373

Copy link

openshift-ci bot commented Sep 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign evidolob for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Sep 26, 2024

@lilyLuLiu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-crc 88a0985 link true /test integration-crc
ci/prow/security 88a0985 link false /test security
ci/prow/e2e-microshift-crc 88a0985 link true /test e2e-microshift-crc
ci/prow/e2e-crc 88a0985 link true /test e2e-crc

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@cfergeau
Copy link
Contributor

cfergeau commented Oct 1, 2024

Can you provide more details about what's going wrong? It looks like we are getting malformed XML and are fixing it with sed? Is there a way to fix the input data so that it's well forme xml?

@adrianriobo
Copy link
Contributor

Yeah not sure about this exact case, but what I can tell is that junit does not have a unified accepted xml schema it has several versions and depending on the tool it uses one or another, so may this is the reasoning for this, but if we do it here (customize it) we need to know which schema we will comply with.

@albfan
Copy link

albfan commented Oct 2, 2024

What I detect reviewing the attach xml files is some tags are writed with &#lt; and &#gt;

I have to do similar replacements than Lu to have a readable text:

  • &#lt;: <
  • &#gt;: >
  • &#xA;: \r

checking https://reportportal.io/docs/log-data-in-reportportal/ImportDataToReportPortal/

@albfan
Copy link

albfan commented Oct 3, 2024

We have this info from reportportal maintainers: reportportal/reportportal#1038

I just import one example with failures:

https://reportportal-openshiftlocal.apps.ocp-c1.prod.psi.redhat.com/ui/#openshift-local/launches/-2/1381/54689/54690/log?logParams=filter.gte.level%3DTRACE%26page.page%3D1

and basically failure tag ignores the message attribute and only adds as stacktrace what is inside failure tag

We only have the message attribute with the message from test. So a cleaner solution would be to transform xml to set the message value into failure content value

filter.xsl

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>

<!-- identity transform -->
<xsl:template match="@*|node()">
    <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="failure">
    <xsl:copy>
        <xsl:value-of select="@message"/>
    </xsl:copy>
</xsl:template>

</xsl:stylesheet>

test.xml

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="crc" tests="39" skipped="0" failures="2" errors="0" time="3272.246116512">
  <testsuite name="4 Openshift stories" tests="4" skipped="0" failures="0" errors="0" time="865.370507627">
    <testcase name="Overall cluster health" status="passed" time="681.654099201"></testcase>
    <testcase name="Mirror image to OpenShift image registry" status="passed" time="15.564511093"></testcase>
    <testcase name="Pull image locally, push to registry, deploy" status="passed" time="21.096793075"></testcase>
    <testcase name="Install new operator" status="passed" time="147.052302434"></testcase>
  </testsuite>
  <testsuite name="Basic test" tests="4" skipped="0" failures="1" errors="0" time="898.635556387">
    <testcase name="CRC version" status="failed" time="0.048058594">
      <failure message="Step stdout should contain correct version: output did not match. Expected: &#39;2.41.0+b0e3fb&#39;, Actual: &#39;CRC version: 24.10.01+b0e3fb&#xA;OpenShift version: 4.16.7&#xA;MicroShift version: 4.16.7&#39;"></failure>
    </testcase>
    <testcase name="CRC help" status="passed" time="0.032533415"></testcase>
    <testcase name="CRC status" status="passed" time="0.030564059"></testcase>
    <testcase name="CRC start usecase" status="passed" time="898.521600977"></testcase>
  </testsuite>
</testsuites>
xsltproc filter.xsl test.xml

result is:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="crc" tests="39" skipped="0" failures="2" errors="0" time="3272.246116512">
  <testsuite name="4 Openshift stories" tests="4" skipped="0" failures="0" errors="0" time="865.370507627">
    <testcase name="Overall cluster health" status="passed" time="681.654099201"/>
    <testcase name="Mirror image to OpenShift image registry" status="passed" time="15.564511093"/>
    <testcase name="Pull image locally, push to registry, deploy" status="passed" time="21.096793075"/>
    <testcase name="Install new operator" status="passed" time="147.052302434"/>
  </testsuite>
  <testsuite name="Basic test" tests="4" skipped="0" failures="1" errors="0" time="898.635556387">
    <testcase name="CRC version" status="failed" time="0.048058594">
      <failure>Step stdout should contain correct version: output did not match. Expected: '2.41.0+b0e3fb', Actual: 'CRC version: 24.10.01+b0e3fb
OpenShift version: 4.16.7
MicroShift version: 4.16.7'</failure>
    </testcase>
    <testcase name="CRC help" status="passed" time="0.032533415"/>
    <testcase name="CRC status" status="passed" time="0.030564059"/>
    <testcase name="CRC start usecase" status="passed" time="898.521600977"/>
  </testsuite>
</testsuites>

@albfan albfan closed this Oct 10, 2024
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 this pull request may close these issues.

4 participants