gfoidl / trx2junit

Transforms XML from trx-Testresults to JUnit-Testresults / trx to JUnit XML and the other way round
MIT License
70 stars 17 forks source link

TrxTestResultXmlParser can read more result types #76

Closed gfoidl closed 4 years ago

gfoidl commented 4 years ago

The following result types are now "understood":

According the xml-scheme these result-types share common elements from TestResult. Specific elements aren't processed, it's more about to understand and read the elements from <Result>.

Fixes #74

gfoidl commented 4 years ago

@jsingh-qualitrol here you have a preview, please give it a try.

# deinstall current version
dotnet tool uninstall -g trx2junit

# install preview
dotnet tool install -g trx2junit --version 1.3.2-preview-1 --add-source https://pkgs.dev.azure.com/gh-gfoidl/github-Projects/_packaging/gfoidl-public/nuget/v3/index.json
jsingh-qualitrol commented 4 years ago

@gfoidl Just wanted to bring to your notice that when we try to do conversion, we get only TestSuite and not including Test cases which are grouped in each TestSuite. Do we have any way in which we can get Test Cases as well with TestSuite.

gfoidl commented 4 years ago

I can't follow what you mean. Can you show some simple examples to get a clear picture what your intention is? Otherwise it's not actionable for me.

jsingh-qualitrol commented 4 years ago

TestResults_trx.txt TestResults.txt The TestResult_trx.txt is having 43 TestSuite and 150 Test Cases, however we we convert it we get to see only 43 TestSuite and the testcases which are grouped in it are not converted. Hope this helps!

gfoidl commented 4 years ago

Just show some simple trx-xml here in the comments directly. No 150 Testcases. I don't want to dig through this. Keep it as simple as possible.

jsingh-qualitrol commented 4 years ago

Let me make it simple for you, now i have 1 Testsuite, which has 7 TestCases. Please have a look. TestResults.txt TestResults_trx.txt

gfoidl commented 4 years ago

simple for you

For me 1523 lines is not defined as simple 🤣, anyway.

Did you try https://github.com/gfoidl/trx2junit/pull/76#issuecomment-650802008? With this version I'll get TestResults.xml.txt which seems ok.

jsingh-qualitrol commented 4 years ago

I tried with version 1.3.2-preview-1 and i could see the Test Cases are shown here. Now i will run it in Jenkins to see the execution results are shown after Test are executed. Like Pass /Fail etc. 👍

gfoidl commented 4 years ago

While trying the larger sample (https://github.com/gfoidl/trx2junit/pull/76#issuecomment-658773014) I found another bug, which I'm fixing right now --> https://github.com/gfoidl/trx2junit/pull/77

jsingh-qualitrol commented 4 years ago

Please also ensure that we get Execution Status as well Like PASS/ FAIL/Not Executed / Skipped.

gfoidl commented 4 years ago

Please also ensure that we get Execution Status as well Like PASS/ FAIL/Not Executed / Skipped.

Doesn't this show up? I think according the junit-scheme all relevant attributes are set. There is no value for pass or fail, as the reader has to deduce it from the test- and error-count.

jsingh-qualitrol commented 4 years ago

Hello @gfoidl ,

Today when i am converting the trx file i get error: image TestResult_new.txt

jsingh-qualitrol commented 4 years ago

Yesterday, i was able to convert it successfully and today i get Object reference error. Please have a look. hope to hear from you soon.

gfoidl commented 4 years ago

Yeah, (unfortunately) I know this one --> see https://github.com/gfoidl/trx2junit/pull/76#issuecomment-658831401 I'll release a new preview, so you can test with this one. Just a few minutes...

gfoidl commented 4 years ago

@jsingh-qualitrol here you have a new preview, please give it a try.

# deinstall current version
dotnet tool uninstall -g trx2junit

# install preview
dotnet tool install -g trx2junit --version 1.3.2-preview-2 --add-source https://pkgs.dev.azure.com/gh-gfoidl/github-Projects/_packaging/gfoidl-public/nuget/v3/index.json
jsingh-qualitrol commented 4 years ago

Yes it is working fine now. Is it stable version to use on production machine?

gfoidl commented 4 years ago

Yes it is working fine now.

Perfect 😄

Is it stable version to use on production machine?

Yes. But I'll release a new version (not a preview version) is a moment. Just waited for your confirmation that it works.

gfoidl commented 4 years ago

--> https://github.com/gfoidl/trx2junit/releases/tag/v1.3.2 respectively https://www.nuget.org/packages/trx2junit/1.3.2

jsingh-qualitrol commented 4 years ago

Hello @gfoidl In trx file we usually notice that the classname is shown as fully qualified name as shown in pic image And same is been converted as shown in xml file image

So i want to know from you can we trim the classname till its first comma and the extra info should not be getting converted in xml file. For eg : image

Please let me know about it.

jsingh-qualitrol commented 4 years ago

Hello @gfoidl

Again we are getting error "Object reference to an instance": image

Please have a look at it.