-
-
Notifications
You must be signed in to change notification settings - Fork 766
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 summary confusingly list tests marked as skip()
under pending
#3014
Comments
Oof, I think this is a long overlooked hangover from 2.x to 3.x when we essentially renamed the pending example behaviour to skipped (where as it used to be a duality), the count here is actually skipped examples if memory serves, as pending examples are expected to fail (count as passed) or don't fail (count as failed) |
If the desired outcome of my example is:
Ie, rename pending to skipped in the summary, then I'd be happy to submit a PR. I'm fine pretty much whatever way makes it clear when tests are running/pending vs skipped. Btw, I think pending is a neat feature, I wish more test ecosystems supported the concept. |
Turns out my memory fails me and this count includes both skipped and "passing" pending examples, as they're both in the output for pending, so to seperate this we'd need to seperate that count and the output for them, which is larger than just a rename |
Hey @JonRowe, I'd like to work on this. However, I'm new to this project, so I need some guidance. I've noticed that "skipped" examples are marked both as "pending" and "skip" in My (maybe naive) approach was to simply add a new count (i.e.
Which could be read as: "2 pending examples, out of which 1 was skipped". What are your thoughts on this? |
@danielmbrasil can you clarify why you'd opt for
rather than
?? If it's just implementation details, then we probably should ignore that and first decide what makes sense for the user... in this case, it'd be straightforward to implement either one since the latter could also be implemented by just adding a new Personally, I think that |
Hi @jeffwidman. So, from what I understood from the source code (correct me if I'm wrong), "skipped" tests are both marked as "pending" and "skip" in their metadata. Here's a code snipped from rspec-core/lib/rspec/core/pending.rb Lines 124 to 127 in 5e04142
Thus, the implementation as-is seems to consider "skipped" tests as a subset of "pending". The summary could indeed be something like this
by changing how this method rspec-core/lib/rspec/core/notifications.rb Lines 318 to 320 in 5e04142
works and adding a Both this approach and my suggestion don't seem to break anything as they're only introducing a new count to the summary. I suggested showing the "skipped" count as a subset of "pending" because internally that seems to be the case. I agree with you that showing two different counts (since both "skip" and "pending" behave differently) looks better. However, I don't know which approach would work better in terms of compatibility. Again, I'm pretty new to RSpec so I might have understood something wrong 😄. I'd be glad to work on it, though! |
Output wise I prefer |
@danielmbrasil Curious if this is something you're still interested in working on? |
I guess unmarking examples as pending when skipped is way beyond my league at the moment, so I'm not working on this. |
I recently learned that there's an actual difference between marking a test as
pending()
(test runs, expected to fail) vsskip()
(test doesn't run).However, this isn't clear from the test run summary:
I would have expected it to say instead:
Clearly differentiating between "skipped" and "pending" in the test summary will reduce confusion (I literally had no idea they behaved different! Thought they were just aliases of each other...). It will also make it quicker to realize a slow test suite may just need a few pending failures marked as skipped until someone has time to address them.
output of
rspec --version
:The text was updated successfully, but these errors were encountered: