Giter Club home page Giter Club logo

Comments (5)

NikolayPianikov avatar NikolayPianikov commented on June 17, 2024

@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.

AntonSmolkov avatar AntonSmolkov commented on June 17, 2024

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.

AntonSmolkov avatar AntonSmolkov commented on June 17, 2024

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.

AntonSmolkov avatar AntonSmolkov commented on June 17, 2024

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):

  1. Inside test projects, add nuget-references to Microsoft.NET.Test.Sdk, TeamCity.VSTest.TestAdapter and test-platform specific adapters. As described here

  2. 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)' != ''"/>

  3. 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.

NikolayPianikov avatar NikolayPianikov commented on June 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.