aspnet / Testing

[Archived] Testing infrastructure, including support for xUnit.net and StyleCop. Project moved to https://github.com/aspnet/Extensions
66 stars 40 forks source link

No xunit.runner.kre compatible with Beta2 and VS 2015 CTP 5 #65

Closed giggio closed 9 years ago

giggio commented 9 years ago

On the aspnetmaster feed xunit.runner.kre does not exist. If you use the aspnetvnext and allow for "xunit.runner.kre": "1.0.0-*" on your package.json as described on the wiki in this repo (this page) you will get today version 1.0.0-beta4-1041. If you let that happen, this is what happens to Visual Studio: image Nothing works on VS 2015 CTP 5. If you install k, upgrade to beta2, you can cd into the project dir, and then you can kpm compile, and even k test, and it will all work. It is VS that is completely lost.

Test discovery also does not work, so this is definitely linked to issue #64.

I am not sure if we are supposed to keep using xunit.kunner with beta2, but I tried and it also does not work. It does not even install.

Until beta1 and VS 2015 Preview I was able to use a rc1 package. But they have all been taken down from myget, and now no package works.

I need some workaround to use xunit.runner.kre and VS. I know this is still early beta stages, but I am already working on it.

To repro: create a VM on azure using the latest VS 2015 template, create a ASPNET class library, try to add xunit.runner.kre, it won't find the pkg. Add the aspnetmaster feed to VS, it will not find the pacakge. Add the aspnetvnext feed, it will find a beta4 package and restore it. Edit the Class1.cs file, you will see that you don't get intellisense for Xunit. Add using Xunit and create a method with a Fact attribute. Close VS, open it again, you will see the above errors. VS can't find System, can't find anything. Oddly enough, you are able to debug if you add the script to package.json. But VS just became notepad until this is fixed.

bojanrajkovic commented 9 years ago

I think you need the xUnit feed -- http://www.myget.org/F/xunit is what works for me, and the runner is xunit.runner.aspnet, version is 2.0.0-*.

giggio commented 9 years ago

@bojanrajkovic Also does not work. Tried with 2.0.0-rc1-build39 and got the exact same problem. What specific version are you using? Are you using with Beta2?

kiripk commented 9 years ago

I have the same issue. @giggio have you found a way to solve this problem?

giggio commented 9 years ago

Partially. I had the rc1 npkgs cached, so I uploaded them to a local nuget server. VS would not break anymore, but would not find the tests. So we gave up and are back to using the beta2 klr with beta1 packages and vs2015 ctp5, and the cached npkgs.

giggio commented 9 years ago

Hello there, anyone looking into this issue? I can see Beta3 is almost done, I would really like to have better support for unit tests, if not possible on Beta2, maybe for Beta3 and the next VS.

davidfowl commented 9 years ago

Yes we are. We're going to push the required beta2 packages.

giggio commented 9 years ago

Tks, @davidfowl! It will be a lot of help!

djanosik commented 9 years ago

Hi, is there any solution yet? I've tried to use many combinations of packages (xunit.runner.kre, xunit.runner.aspnet. xunit.krunner), but it still does not work. I can run tests in console and I can debug tests, but the intellisense is always broken.

djanosik commented 9 years ago

Temporary workaround:

  1. Comment out xunit.runner.aspnet dependency
  2. Reload project
  3. Uncomment xunit.runner.aspnet dependency

You will not see errors in editor and you can run tests in console.

duncanhunter commented 9 years ago

Thanks @djanosik for the workaround.

giggio commented 9 years ago

I will close this issue as we are in Beta3 now, even though now xunit.runner.kre does not even exist anymore on Nuget: https://www.nuget.org/packages/xunit.runner.kre The xunit runner that comes directly from the xunit mainteiner works on the command line but does not work well with Visual Studio, it actually crashes if you try to open the test explorer window. But at least it works. This wiki page should be updated: https://github.com/aspnet/Testing/wiki/How-to-create-test-projects Anyone trying to get tests to work should be pointed here: http://xunit.github.io/docs/getting-started-aspnet.html