ricardofslp / dotnet-trx-merge

Merge trx files
https://www.nuget.org/packages/dotnet-trx-merge
MIT License
9 stars 4 forks source link

Support merging the folders which support the trx files #52

Open samholder opened 10 months ago

samholder commented 10 months ago

Hi.

I've been expanding use of this and we have some tests that run against the UI and take screenshots and produce code coverage. I've noticed that I get warnings saying that the output is missing when uploading the results, something like:

File at /home/vsts/work/_temp/TestRun2/In/e5919c81-0fce-4782-8a14-28856c4564cc/fv-az461-762/5012254_1_User registers a card and makes a purchase with the stored details.png was not found

This seems related to the fact that we also get an output folder matching the trx name, and once we have merged the trx files this folder does not match the new trx name. I've testing manually and if I move the files from the folder <trxfileName> to <mergedTrxOutputFileName> then the warnings go away and it seems happy.

I'm proposing to add an additional flag to allow merging of supporting folders as well as the trx files, along with a flag to allow deleting of the merged folders (and potentially of the original trx files).

I also think an option to move the trx files/supporting folders to a zip archive which can be uploaded as a build artifact would also be useful, and simpler than having to write the powershell to do it in the pipeline itself.

This would probably be a few PRs, starting with merging supporting folders.

Is this something you would want?

ricardofslp commented 10 months ago

Hi @samholder ,

That would be a nice improvement yes. If we control that with flags it would be ok for me

samholder commented 10 months ago

ok, I've got a busy week this week, but I will look to get something together over the next couple of weeks

ricardofslp commented 9 months ago

Hi @samholder,

Could you provide an example of the output you want to merge. This way I could start working on that first.

ricardofslp commented 9 months ago

Hi @samholder,

Any luck on this?

samholder commented 9 months ago

Hi.

Apologies for going dark on this, I've been too busy to think about this. I will attempt to get an example of what needs to be merged together to show as soon as I can.

samholder commented 9 months ago

AttachmentsInMsTest.zip

I've added an example, with a project to generate the files with attachments. You can see from this that there is one test and in the first run it fails, but in the second run it passes and generates an attachment. In the merge it would be good to include all attachments for passing tests. If failing tests pass in subsequent runs then all attachments should only be for the passing tests I think. If a tests fails repeatedly, then I think attachments for one of those failing tests I think, probably the most recent one.

The attachment contains trx files from a failed run and a subsequent passing run, but if you need more info you should be able to alter the project to generate more attachments etc if you need to

ricardofslp commented 6 months ago

Hi @samholder,

Can you test using this version https://www.nuget.org/packages/dotnet-trx-merge/2.0.0-alpha.0 ? Add the option -c or --copyOriginalFiles

samholder commented 6 months ago

Thanks, I'll try and have a look at this at some point this week

samholder commented 6 months ago

I had a look at this over the weekend, but I was getting an exception when merging the trx when there was only one trx to merge. not sure if this was an existing issue, but I thought that if all the tests passed on the first run and I only had a list of 1 trx file to merge that this would work ok

I'll try and get the trx files that caused the issue, but by default our builds don't spit them out

ricardofslp commented 3 months ago

Hi @samholder ,

Can you give some more feedback on this?