-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to skip non-test .NETStandard assemblies? #900
Comments
HI @synek317, The VS Project Loader hasn't had a maintainer for the last few years, and hasn't really been updated for some of the later features of csproj files. @CharliePoole has recently become maintainer of this project and is currently considering it's future - I'm sure he'd be interested in any offers of help! Can you clarify - do your netstandard20 assemblies contain the |
@ChrisMaddock Did you want to hang onto this one for a bit rather than transfer to vs-project-loader? That's OK with me, if so. |
I think this issue is in the correct place, as reported, this is an engine problem. There are a couple of other considerations for the extension beyond this perhaps however, here's what I think: For the engine:
For the Extension: |
Thanks for mentioning I will check how adding this attribute works in netstandard + net4x (+net5 maybe) mixed solution. |
There's a bit of a problem in that
IOW, you should only need the attribute on an assembly, which is not a test assembly but has a reference to the framework. An example would be an assembly containing your own extensions to the framework. Knowing the definition, however, is only useful in deciding whether it's your code or the engine's that needs to be fixed. 😄 |
@nunit/engine-team I hadn't really thought about this before, but maybe part of the problem here is that the definition of Cases we may need to deal with...
The attribute is only useful for case 3, since you can't have the attribute without adding a reference to the framework. Without the attribute, cases 2 and 3 are indistinguishable. But when a user uses the console option, I think they are really talking about case 4. What do you think? How should we deal with this? One possibility: always skip tests with the attribute and additionally skip tests without a reference to a framework if the option is used. But what do we do about case 2, where there's a reference but no tests. Is that common enough to be important? |
@synek317 I realize this is pretty old. Assuming you are still around, can you try the latest dev build from our myget feed? I've made substantial changes in the engine in order to compensate for unsupported frameworks and unmanaged assemblies throwing an exception when we try to analyze them. These changes will be in 3.18.2 and I'd like to report this as fixed but I don't have a specific repro to work with. UPDATE: I went back up and read the title. I do have a test using a solution with a .NETStandard assembly, so I'm going to report this as fixed. Feel free to tell me if you still find a problem and I'll re-open. |
This issue has been resolved in version 3.18.2 The release is available on: |
I have a solution with multiple projects. My current environment is Linux + Mono + nunit3-console. I used to use
nunit3-console ... --skipnontestassemblies *.sln
.Now, I'm trying to make my project compile on both, mono and .net core. So I'm porting my libraries to use framework netstandard20 while keeping test assemblies to use net461.
Unfortunately, nunit3-console no longer skips my non-test assemblies because it discovers unsupported framework before it checks if this assembly has tests or not. What is even worse, I cannot try with
<TargetFrameworks>
instead of<TargetFramework>
because of a bug in the project loader: nunit/vs-project-loader#37Is there any other way I can keep passing sln path to nunit3-console and skip unsupported assemblies?
The text was updated successfully, but these errors were encountered: