0
votes

Can I run dnx test on Bluemix?

I set up a delivery pipeline for build and deploy stage. The ASP.NET 5 code is getting built and deployed successfully. But when I tried adding some unit tests, I'm not sure how to run them.

I added dnx test in the command. But it fails saying _customer_script.sh: line 3: dnx: command not found

Please guide.

1

1 Answers

0
votes

Dnx is installed per user. So if user X installs dnx, then user Y does not have dnx added to path and hence can not use it. This is probably the problem here.

So you can add the path to dnx to system PATH variable or call dnx.exe in explicit way with full path given like "call C:/Users/teamcity/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-final/bin/dnx.exe test".

Few other things:

  1. When you call dnx the default runtime is used. If you execute "dnvm list" you can see which one is default. This is important because it defines processor architecture of compilex/executed assembly and whether it is a clr or coreclr. So if you execute "dnx test" with coreclr as default then your tests are going to be executed for dnxcore50, otherwise if it is clr then for dnx451/dnx451/dnx46.
  2. You need to set working directory to your project with tests
  3. dnx by default runs everything in Debug mode, so if you want to run in in Release then you need to run it with --configuration Release parameters. These params must be put before "test". So it is "dnx --configuration Release test"