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

Error parsing JUnit report on Azure DevOps #431

Closed
iPlessmann opened this issue Jun 3, 2024 · 5 comments
Closed

Error parsing JUnit report on Azure DevOps #431

iPlessmann opened this issue Jun 3, 2024 · 5 comments
Labels
smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear

Comments

@iPlessmann
Copy link

I am using the Pact Verifier CLI version 1.1.2 from my AzDO pipeline, the verifier does provides a flag --junit to write the results as a JUnit result, that functionality works and i get the following output:

<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite id="0" name="MyService" package="testsuite/MyService" tests="4" errors="0" failures="0" hostname="localhost" timestamp="2024-04-11T08:13:30.445406Z" time="1.512"><testcase name="Verifying a pact between MyService2 and MyService - Get greeting" time="0.599"/><testcase name="Verifying a pact between MyService2 and MyService Given aDifferentProviderState - Get greeting with (mapped) provider state" time="0.303"/><testcase name="Verifying a pact between MyService2 and MyService Given unmappedProviderState - Get greeting with (unmapped) provider state" time="0.296"/><testcase name="Verifying a pact between MyService3 and MyService - Get greeting" time="0.314"/><system-out><![CDATA[The pact at https://my-broker-ngt.pactflow.io/pacts/provider/MyService/consumer/MyService2/pact-version/011feb9507a8b024c73385911395230a1d71b20c is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version from the main branch 'myservice-pacts' (27.1.0)
This pact is in pending state for this version of MyService because a successful verification result for MyService has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at https://docs.pact.io/go/pending

Verifying a pact between [1mMyService2[0m and [1mMyService[0m

  Get greeting (3s 234ms loading, 599ms verification)
    returns a response which
      has status code [1m200[0m ([32mOK[0m)
      includes headers
        "[1mContent-Type[0m" with value "[1mapplication/json[0m" ([32mOK[0m)
      has a matching body ([32mOK[0m)

  Get greeting with (mapped) provider state (3s 234ms loading, 303ms verification)
     Given aDifferentProviderState
    returns a response which
      has status code [1m200[0m ([32mOK[0m)
      includes headers
        "[1mContent-Type[0m" with value "[1mapplication/json[0m" ([32mOK[0m)
      has a matching body ([32mOK[0m)

  Get greeting with (unmapped) provider state (3s 234ms loading, 296ms verification)
     Given unmappedProviderState
    returns a response which
      has status code [1m200[0m ([32mOK[0m)
      includes headers
        "[1mContent-Type[0m" with value "[1mapplication/json[0m" ([32mOK[0m)
      has a matching body ([32mOK[0m)

This pact is still in pending state for MyService as a successful verification result has not yet been published
The pact at https://my-broker-ngt.pactflow.io/pacts/provider/MyService/consumer/MyService3/pact-version/b3934c7708d47b1596480e55c61970a2d31f0e50 is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version from the main branch 'myservice-pacts' (27.1.0)
This pact has previously been successfully verified by MyService. If this verification fails, it will fail the build. Read more at https://docs.pact.io/go/pending

Verifying a pact between [1mMyService3[0m and [1mMyService[0m

  Get greeting (3s 234ms loading, 314ms verification)
    returns a response which
      has status code [1m200[0m ([32mOK[0m)
      includes headers
        "[1mContent-Type[0m" with value "[1mapplication/json[0m" ([32mOK[0m)
      has a matching body ([32mOK[0m)

]]></system-out></testsuite></testsuites>

But when AzDO has to parse that result, it fails with error: Error : '', hexadecimal value 0x1B, is an invalid character. Line 5, position 26..

I think the issue is due to the bold tags used around MyService, for example Verifying a pact between [1mMyService2[0m and [1mMyService[0m the [1m is the culprit i think.

@YOU54F
Copy link
Member

YOU54F commented Jun 5, 2024

duplicate of #421

workaround in the attached thread, fix should be in the next released version of the verifier cli

@mefellows mefellows added the smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear label Jun 6, 2024
Copy link

github-actions bot commented Jun 6, 2024

🤖 Great news! We've labeled this issue as smartbear-supported and created a tracking ticket in PactFlow's Jira (PACT-2021). We'll keep work public and post updates here. Meanwhile, feel free to check out our docs. Thanks for your patience!

@YOU54F
Copy link
Member

YOU54F commented Jun 14, 2024

@iPlessmann
Copy link
Author

Tested it and it works! Thank you very much

@YOU54F YOU54F closed this as completed Jun 14, 2024
@YOU54F
Copy link
Member

YOU54F commented Jun 14, 2024

awesome! thanks for letting us know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
Projects
None yet
Development

No branches or pull requests

3 participants