JetBrains / meta-runner-power-pack

A set of Meta-runners for TeamCity
Apache License 2.0
257 stars 125 forks source link

xUnit.net + dotCover does not work anymore with 2.3 #106

Open noujaimc opened 6 years ago

noujaimc commented 6 years ago

Hello, since the release of 2.3 of XUnit, the meta-runner does not work anymore. The XUnit team changed the location of the xunit.runner.console.

The xunit.runner.console NuGet package has been changed; notably, the path to the net452 executables has moved from tools\ to tools\net452. You will need to update any paths which previously hard-coded this path.

You guys will have to check the version of XUnit downloaded from the feed to determine if the console application is in tools or tools\net452.

Also, I noticed that after the changes that @Asif Ahmed on supporting multiple paths, the script gives me the the following errors:

##teamcity[buildStatus text='Method invocation failed because [System.Object[]
[13:14:37]
[Step 1/1] Value should end with "'"
Valid property list format is (name( )*=( )*'escaped_value'( )*)* where escape symbol is "|"
[13:14:37][Step 1/1] ] does not contain a method named 'Trim'.' status='FAILURE']
[13:14:37][Step 1/1] ##teamcity[message text='Method invocation failed because [System.Object[]

I do not have any problems using commit d31019448db4dc03f9b047791c6b4e7cbc361413.

Thank you.

vrohit13 commented 6 years ago

This might help, so as to make it work against XUnit 2.3.0: https://github.com/JetBrains/meta-runner-power-pack/issues/96 (Comments section)

valeriob commented 6 years ago

Do you have a work around for this ? Both xUnit.net meta-runner for TeamCity and this plugin stopped working 🛩

theit8514 commented 6 years ago

@valeriob I also had this issue and found that the problem exists because of this code: https://github.com/JetBrains/meta-runner-power-pack/blob/447d45491fa2a2617b12862ce3846f6141ce31c6/xUnit.net-dotCover/MRPP_xunit_dotcover.xml#L107

Remove the .Trim() call from $excludedAssemblies, it's an array not a string.

E.g. $assembliesFromPath = (Get-ChildItem $filterPath.Trim() -Recurse -Exclude $excludedAssemblies | select -ExpandProperty FullName)

I also had an issue with the dotCover tool variable changing in 2017.2, so updating the $dotCoverExecutable to %teamcity.tool.JetBrains.dotCover.CommandLineTools.bundled% made everything work fine.

edit: Also have an issue with the installed xunit version changing the binary path. Adding net452 to the tools path fixes that. $xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net452\$xUnitExe" | Resolve-Path

valeriob commented 6 years ago

Thanks @theit8514 i'll try that ! Yep dot cover is broken in 2017.1 for netstandard libraries, i tried to update the tool in the admin console and make it default, but the build process kept using the old one. I ended up upgrading teamcity to 2017.2 with the new dotcover (109 i think ) inside. It sucked, it took so much to understand what was wrong, i really thought it was my code...

valeriob commented 6 years ago

Well i found out that the plugin uses this teamcity variable %teamcity.tool.dotCover% but i do not have it defined in 2017.2 -.- is it just me or it's a breaking change ?

[12:06:50][Step 1/1] Pacchetto "xunit.runner.console.2.3.1" Š gi… installato [12:06:50][Step 1/1] Found test assemblies: C:\TeamCity\buildAgent\work\3915e306ed37130f\src\OnTms\OnTms.Test\bin\Release\OnTms.Test.dll C:\TeamCity\buildAgent\work\3915e306ed37130f\src\OnTms\OnTms.Tenants.Test\bin\Release\OnTms.Tenants.Test.dll C:\TeamCity\buildAgent\work\3915e306ed37130f\src\OnTmsCarichi\OnTms.Carichi.Test\bin\Release\OnTms.Carichi.Test.dll [12:06:50][Step 1/1] Run test coverage: True [12:06:50][Step 1/1] dotCoverExecutable: %teamcity.tool.dotCover% [12:06:50][Step 1/1] dotCoverArgs: cover coverage_settings.xml /LogFile=dotCoverXunitLog.txt /ReturnTargetExitCode [12:06:50][Step 1/1] ##teamcity[buildStatus text='Impossibile caricare il modulo '%teamcity.tool.dotCover%'. Per ulteriori informazioni, eseguire 'Import-Module %teamcity.tool.dotCover%'.' status='FAILURE']

vrohit13 commented 6 years ago

@theit8514 I understand that .Trim() should be removed. Curious to know why it worked in my case. Could it be due to a more recent version of Powershell ?