-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Zero tests ran when using SonarCloud with "sonar.dotnet.excludeTestProjects=true" #621
Comments
Using version 0.1.807 and the latest. |
@StefH but it works locally? |
Running
Running with |
Hmm... I'll see if I can spin up my own azure pipeline. In the mean-time, I don't know if it'll have anything useful in it, but could you get access to the log it produced?
|
Hmm so I've ran the same command on an azure ubuntu pipeline and it's running fine for me annoyingly: https://dev.azure.com/thomhurst/thomhurst/_build/results?buildId=625&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=5caf77c8-9b10-50ef-b5c7-ca89c63e1c86 It's like the source generators aren't running for you, but I can't see any error output or anything. |
Note that my test project uses TUnit and the library being tested is using TUnit.Core |
I've just pushed out a new version: 0.1.817 Could you try upgrading to that and use the If I could see that it would help determine if it's actually discovering anything. |
How to use that flag?
|
With So this should work: |
The The diag file shows:
|
Yeah 0 tests are discovered and no test node messages are being sent. Tests are registered via source generation, so if none are registered, your source generator is either failing to execute, or it's just not executing for some reason... I couldn't see any source generator failure messages in your pipeline. And I don't know why they wouldn't run at all. This is stumping me 😕 |
Maybe because of the |
This is my PR btw WireMock-Net/WireMock.Net#1179. |
But you've done a build in the previous step so all the code should be generated by that. |
correct |
@StefH Okay so this is REALLY weird. I forked your repo/branch, and recreated your pipeline on my own azure devops. I couldn't run some bits due to missing marketplace actions and tokens, so I disabled those steps. And now it's passing with 1 test successfully run! I wonder if Does it pass for you if you disable that step at all? |
You can see the last 3 commits I pushed here: thomhurst/WireMock.Net#1 |
Thank you for analyzing this issue. Tomorrow I'll try disabling sonar and maybe other steps. I keep you updated. |
@StefH I would be interested, whether SonarQube works with TUnit, in case of code coverage and code smells. Would be nice to know it, if your pipeline is running. Thanks. |
@StefH @SaschaBa I found this issue which is causing Sonar to break source generators: SonarSource/sonar-scanner-msbuild#1469 You're setting the flag that causes the problem so it's most likely that |
Brilliant. I'll close this then if all is good as this is a sonar scanner bug |
When running TUnit tests in Azure DevOps on a Linux image, no tests are found?
Link to failed DevOps Build: (https://dev.azure.com/stef/WireMock.Net/_build/results?buildId=9212&view=logs&j=3bb91939-0fa9-522e-f055-9541addbc62d&t=dd3b8b64-cf8b-5723-be35-20e4eb86e2a7)
Command to run:
The text was updated successfully, but these errors were encountered: