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

No project references found. Please add a project reference to your test project and retry. #3065

Open
MartijnvAdrichem opened this issue Oct 11, 2024 · 1 comment
Labels
🐛 Bug Something isn't working hacktoberfest https://hacktoberfest.digitalocean.com

Comments

@MartijnvAdrichem
Copy link

Describe the bug
A simple project without any stryker configuration gives this error.
afbeelding

This happend because there was a test reference in the non-test project:

Removing this packageReference fixes the problem. Maybe with a better error message it would be quicker to find the root cause.

Logs
For us to best assist you in diagnosing the problem we would ask you to run stryker with the option --log-to-file or -L and to attach the resulting logs to the issue.
log-20241011.txt

Expected behavior
calling 'dotnet stryker' should give a clear error when it only finds test projects.

Desktop (please complete the following information):

  • OS: Windows
  • Type of project Asp .NET Core
  • Framework Version .net 8
  • Stryker Version: latest
@MartijnvAdrichem MartijnvAdrichem added the 🐛 Bug Something isn't working label Oct 11, 2024
@rouke-broersma
Copy link
Member

For the simple case I guess we could add a check that the solution only contains test projects, and provide a nice error message. For the more complex case with multiple valid projects and some invalid projects due to test framework references in non-test projects I'm not sure how we would detect/solve that.

@rouke-broersma rouke-broersma added the hacktoberfest https://hacktoberfest.digitalocean.com label Oct 11, 2024
rouke-broersma added a commit that referenced this issue Oct 28, 2024
Fixes #3065

Update error handling to provide a clear message when only test projects are found.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/stryker-mutator/stryker-net/issues/3065?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working hacktoberfest https://hacktoberfest.digitalocean.com
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants