Skip to content
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

Test Discovery does not work for Full Framework test projects #7

Open
csurfleet opened this issue Mar 29, 2018 · 13 comments
Open

Test Discovery does not work for Full Framework test projects #7

csurfleet opened this issue Mar 29, 2018 · 13 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@csurfleet
Copy link
Collaborator

If you reference the xunit.gherkin.quick nuget from a full-framework xunit project, the scenarios will never be discovered.

I'm not sure if this is an extra configuration step I'm missing, something that needs fixing in the nuget, or if it is simply not possible. I can throw up a branch with the consumer project converted to demonstrate too.

@alborozd
Copy link

the same problem

@alborozd
Copy link

I updated xunit.runner.visualstudio dependency and it solved my problem. (from template I had version 2.3.1 in the project but the last version is 2.4.0 at the moment)

@ttutisani
Copy link
Owner

Wow, that's very good to know!
Thanks @alborozd

I think this can help others, too.

@ttutisani ttutisani added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 27, 2018
@richard-haslam
Copy link

richard-haslam commented Oct 11, 2018

I have asked a question on stackover flow today and wonder if it is related to this issue?

https://stackoverflow.com/questions/52757138/how-to-get-xunit-to-find-dotnet-core-tests-on-linux-using-xunit-gherkin-quick

I'm pretty new to all of this.. so if it's not related at all.. just a bit desperate to find an answer this. (I have tried xunit.runner.visualstudio and it didn't help.

@ttutisani
Copy link
Owner

Did you try the suggestion by @alborozd above?

I updated xunit.runner.visualstudio dependency and it solved my problem. (from template I had version 2.3.1 in the project but the last version is 2.4.0 at the moment)

@richard-haslam
Copy link

Thanks for the reply, yeah I have tried doing that and it doesn't seem to make any difference.

@ttutisani
Copy link
Owner

Got it. Needs to be investigated. I have not tried it myself yet. I'm using the framework from .NET Core only so far.

@ttutisani ttutisani removed the good first issue Good for newcomers label Mar 28, 2019
@cathalmchale
Copy link
Contributor

The Features text files are very particular about text encoding.
I had an issue where a new Feature file and corresponding test class would not be discovered and would not run (locally or on build box). But many existing features existed and run without issue.
I created new files with new names and cleaned up the text and simplified the Feature and test to absolute basics. Nothing worked, the test would not be discovered.

So I took a Feature file that I knew worked and copied it as a starting point. Then manually edited it so that it eventually looked like the one the didn't work. But this time the test could be discovered and run, without issue.

Looking at the two files (Working.feature and NotWorking.feature) in Notepadd++ with special chars highlighted or in BeyondCompare revealed nothing useful. However, I don't doubt that there was something abnormal about the encoding.

Summary
If you have a Feature file that refuses to be discovered by the test runner, but have other files that are being discovered fine, copy one of the good ones as a starting place and avoid copy-paste from PDFs etc.

@ttutisani
Copy link
Owner

@cathalmchale that's a good finding, thanks for posting it here!

Do you mind to open a new issue with that same info in it? That way each issue is for one particular topic and not several - easier for the other readers when they browse through the issue topics.

@ttutisani
Copy link
Owner

I just tried and this issue indeed happens. I don't see tests discovered for the normal (full) .net framework. I guess Xunit behaves differently for .net framework as opposed to .net core.

Does anybody have any new findings around this issue?

@ttutisani
Copy link
Owner

Following up with Xunit authors about this: xunit/xunit#1993

I am suspecting it has something to do with Xunit, but not sure yet.

@princefishthrower
Copy link

I'm struggling as well for my tests to be found in an aspnetboilerplate test project. The only way I can get my methods to be found by the test runner is with the xUnit Fact decorator on each method, but this is actually undesired, because xUnit won't run the methods sequentially.

I'm on the latest xunit.runner.visualstudio (2.4.3)

Not sure what else is needed, I inherit from the Feature class, use the FeatureFile, Given, When, and Then` decorators...

@minhhieugma
Copy link

still facing the same until now. So, in short, this library doesn't support .NET Framework. That's it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants