Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build and test ASP.NET Core solution on Jenkins

I want to build our ASP.NET Core solution on Jenkins continuous integration server.

The steps that I need run are:

  1. dotnet restore
  2. build solution: dotnet build or msbuild14 ?
  3. run test: dotnet test
  4. test coverage

Anybody knows or have the scripts to do the point 2 to 4?

like image 755
Marcelo Oliveto Avatar asked Oct 29 '22 21:10

Marcelo Oliveto


1 Answers

The thing you have to keep in mind is which directory is jenkins executing from. dotnet restore can be run at the root, but dotnet build and dotnet test need to be run from the same directory as the project.json.

Test coverage is a separate topic altogether - as of right now (2/1/2017) in Visual Studio Enterprise 2015, code coverage does not work, at least with XUnit, maybe it does with MSTest. dotCover is working now, but I don't know how you could script that and get the results back.

like image 196
Jake G Avatar answered Nov 15 '22 05:11

Jake G