vstest: dotnet test does not discovers tests (xunit + mac)

From @RassulYunussov at https://github.com/dotnet/cli/issues/5949

Interesting thing happening when I add xunit tests to my project. When I start test using command: dotnet test within Visual Studio Code Terminal - everything goes ok. All tests run. But when I run dotnet test from a terminal (without Visual Studio Code) I get error message that says that there is no test available.

Steps to reproduce

dotnet test

Expected behavior

(within Visual Studio Code) Build started, please wait… Build completed.

Test run for /…/bin/Debug/netcoreapp1.1/SomeProject.Tests.dll(.NETCoreApp,Version=v1.1) Microsoft ® Test Execution Command Line Tool Version 15.0.0.0 Copyright © Microsoft Corporation. All rights reserved. Starting test execution, please wait… [xUnit.net 00:00:01.2838115] Discovering: SomeProject.Tests [xUnit.net 00:00:01.4470527] Discovered: SomeProject.Tests [xUnit.net 00:00:01.5129059] Starting: SomeProject.Tests [xUnit.net 00:00:01.7132244] Finished: SomeProject.Tests

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 2.7660 Seconds

Actual behavior

(from terminal) Build started, please wait… Build completed.

Test run for /…/bin/Debug/netcoreapp1.1/SomeProject.Tests.dll(.NETCoreApp,Version=v1.1) Microsoft ® Test Execution Command Line Tool Version 15.0.0.0 Copyright © Microsoft Corporation. All rights reserved. Starting test execution, please wait… No test is available in /…/bin/Debug/netcoreapp1.1/SomeProject.Tests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

Environment data

dotnet --info output: .NET Command Line Tools (1.0.1)

Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1

Runtime Environment: OS Name: Mac OS X OS Version: 10.12 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/1.0.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@smadala I can confirm that adding ulimit -n 4096 to /etc/profile fixed the issue for me. This is a reasonably simply workaround until the issue is fixed in xunit.

OS: OS X 10.11.6 CLI: 1.0.1 (005bd40cd1) SDK: 1.1.0 (928f77c4bc3f49d892459992fb6e1d5542cb5e86)

FWIW, I can confirm this bug. I have a build failing on my Mac locally, but builds fine on a Linux based Jenkins box.

Mac Version: 10.12.3 (16D32)

$ dotnet 
Microsoft .NET Core Shared Framework Host

  Version  : 1.1.0
  Build    : 928f77c4bc3f49d892459992fb6e1d5542cb5e86

$ mono --version
Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/8f6d0f6 Thu Mar  9 11:59:17 EST 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.6.0svn-mono-master/8b1520c)
	GC:            sgen

Will dig into it a bit deeper once I have some time.

@rnowosielski Can you try increase max limit for number of open files per process, Eg: By adding ulimit -n 4096 to /etc/profile.