-
Notifications
You must be signed in to change notification settings - Fork 701
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
guide the user towards solving test-plan issues #7834
Conversation
When 'cabal test' and the error message recommends setting 'tests: True', the next 'cabal test' run is likely to fail with a solver error. The user might incorrectly conclude that setting 'tests: True' made the problem worse, because the failure now occurs earlier (at solving time rather than at testing time). By including the fact that a plan failure is expected in the error message, hopefully users will be more confident that setting 'tests: True' was the right move, so they will be able to focus on the true cause of the problem: the fact that no plan including the tests exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
BTW, in the ideal world, we'd also detect that |
I
|
Good news, that's already the case! If I set
|
Whoa! We live in the ideal world! Edit: Though perhaps it would be clearer with "has been disabled in the configuration (e.g., by a project configuration file setting 'tests: False' and, if so, you may try removing it).". OTOH, longer error messages are more likely not be read at all. |
@Mikolaj This begs for a "Quick-fix: Remove |
@gelisam: your call how exactly it's going to look in the end. Please rebase and merge when ready. |
I don't think |
@gelisam Yep, file detection is a must-have if we want to pull off such a trick :) |
Huh, turns out earlier in the file, there are already some error messages with very good explanations, for both the cabal/cabal-install/src/Distribution/Client/CmdErrorMessages.hs Lines 252 to 276 in cc59881
Maybe a better fix would have been to copy this text from the
|
A good idea IMHO. That would be in addition to what's done in this PR, right? Nothing would be reverted? |
The message for |
I think the explanation you've found covers mostly the case of explicit |
I disagree! Note that I have found two messages, and that there are four relevant messages in total.
|
You are absolutely right. The messages you've found are better than whatever we've brainstormed here (though perhaps can be slightly improved based on our attempts). Indeed I didn't scroll and just read the example message you provided, thinking the source code you've found generates only that. I think we can either revert or remove the changelog from this PR in the amendment PR. I don't have a preference. |
This simpler change (tweaking an error message) came up while discussing a larger PR. Let's make this smaller change first!
When
cabal test
and the error message recommends settingtests: True
, the nextcabal test
run is likely to fail with a solver error. The user might incorrectly conclude that settingtests: True
made the problem worse, because the failure now occurs earlier (at solving time rather than at testing time).By including the fact that a plan failure is expected in the error message, hopefully users will be more confident that setting
tests: True
was the right move, so they will be able to focus on the true cause of the problem: the fact that no plan including the tests exist.Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!