mercredi 17 juin 2020

dotnet test output as xml

Seems strange that it even has to be asked - but I use a build system, I'm running dotnet, and I'm wondering how to get test output from it. After lots of googling, it seems you have to specify a logger - trx. So I tried the obscure

dotnet test --logger "trx:LogFileName=somename.xml"

which seemed to work great. Except - I have lots of projects - and the test output only contained the output from the last one? so more googling, I came up with

dotnet test --logger "trx:LogFilePrefix=some_prefix"

which ends up with timestamped files with the configuration and .trx - but I can rename - which is fine - but the timestamp is only at the second boundary - and I have several projects that finish within a second - which means that again some of the files are getting overwritten.

Is there any way to get all my test output? And in my perfect world, they'd be aggregated into a single file, but if not - I'd really like to get output from project X in a file called X_testresults.xml. Is there any way of achieving that?

I could just loop over all the projects and run dotnet test on each one, but that seems a hack, but also, at the moment my solution works on all platforms, so to preserve that I'll actually have to add another project which just does this.

Aucun commentaire:

Enregistrer un commentaire