Comments (5)
@AnSmol I am no sure I understand. What is hepening when you run xunit tests using dotnet test xxx.sln
with additional argument /p:ParallelizeAssemblies
now? Are they not working as expected?
TeamCity just runs command line tool dotnet to run tests and it tracks tests results. Do you suppose that TeamCity should run several dotnet processes at the same time or something else?
from teamcity-dotnet-plugin.
What is hepening when you run xunit tests using dotnet test xxx.sln with additional argument /p:ParallelizeAssemblies now? Are they not working as expected?
@NikolayPianikov ParallelizeAssemblies
It works as expected, but one .csproj = one test assembly, so effectively it is not parallelization at all. I guess it suppose to work only on solution level.
Do you suppose that TeamCity should run several dotnet processes at the same time ..?
Exactly! Ability to define parallelization level also would be great.
from teamcity-dotnet-plugin.
It's appeared that dotnet test
on .SLN runs test .csproj'es on parallel by default, so i don't even have to append extra flags for xunit.
While investicage all this stuff found following drawbacks of the teamcity-dotnet-plugin step:
-
Lates version of .NET CLI Support plugin ( 0.9.7 ) still appends
-verbosity Normal
instead of-verbosity normal
. Issue. I know the problem is on the VStest's side, but still. -
Can't pass
/p:VSToolsPath="%MSBuildTools16.0_x64_Path%\..\..\..\Microsoft\VisualStudio\v16.0"
as a custom parameter, it converts to"/p:VSToolsPath="%MSBuildTools16.0_x64_Path%\..\..\..\Microsoft\VisualStudio\v16.0""
(extra double quotes) I guess it's because of TW-7964. I would pass this property as a teamcity build parameter, but i don't want it on my other msbuld step which makes build.
from teamcity-dotnet-plugin.
if someone is interested, the complete way to succesfully run dotnet test
on .SLN file (and thus in parallel) containing different kind of projects (Legacy CsProj/ProjectSDK, Legacy Asp.Net/Asp.Net Core, Xunit/Nunit):
-
Inside test projects, add nuget-references to Microsoft.NET.Test.Sdk, TeamCity.VSTest.TestAdapter and test-platform specific adapters. As described here
-
For passing
dotnet test
validation of tested legacy asp.net projects either add/p:VSToolsPath="%MSBuildTools16.0_x64_Path%\..\..\..\Microsoft\VisualStudio\v16.0"
parameter to run or use MSBuild.Microsoft.VisualStudio.Web.targets nuget package inside legacy Asp.Net project.
Both are possible because of default import in leacy asp.net .csproj'es:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''"/>
-
Build solution and run
dotnet test
with--no-build --verbosity normal
. (Verbosity is xunit-specific and must be spelled in lowercase)
So I personally ended up with the following custom powershell script step:
Set-PSDebug -Trace 1
#Have to run via script because of TW-7964
#VSToolsPath overrided to vs build tools one, to make tests on legacy asp.net projects work
#To make adapters service messages work, verbocity must be set as normal or higher, spelled in lovercase
&"%DotNetCLI_Path%" --% test %SLN_FILE% --configuration Release --no-build --verbosity normal /p:VSToolsPath="%MSBuildTools16.0_x64_Path%\..\..\..\Microsoft\VisualStudio\v16.0"
exit $LASTEXITCODE
from teamcity-dotnet-plugin.
@AntonSmolkov You have made a good investigation. Could you share this information in some section of readme? Some git repo with samples could be very useful too :)
from teamcity-dotnet-plugin.
Related Issues (20)
- Invalid semicolon escaping when passing property via .rsp HOT 3
- NUGET_PACKAGES environment variable not being picked up from the system HOT 19
- dotnet test - The argument /noconsolelogger is invalid. HOT 11
- The download link is borken HOT 1
- Generated .rsp file breaks command HOT 7
- dotnet restore returns 401 HOT 2
- .NET Cli output both TeamCity test messages and TRX file for SonarQube. HOT 4
- TC is unable to find DotNetCLI_Path when running a .NET core-based Docker image in a cloud agent HOT 2
- Custom feeds are not working HOT 2
- unmet requirement DotNetCLI_Path exists HOT 5
- Can't run tool install in <custom> HOT 6
- Cannot find MSBuild path on Teamcity Linux build agent HOT 6
- How can I install automatically the .NET Frameworks on an OnPrem Build Agent? HOT 2
- Problem parsing .rsp with .NET SDK 6.0.301 HOT 21
- "Property is not valid" error caused by invalid values in rsp file HOT 6
- Problem with passing empty valued parameter from build configuration to rsp-file HOT 2
- how to run "dotnet test BuildDrop\Test\**\*.UnitTests.dll" HOT 3
- dotnet build with binlog and multiple csproj files HOT 2
- New plugin download? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teamcity-dotnet-plugin.