-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ExUnit: end-of-run test counts wrong when I run mix test
in an umbrella app.
#5426
Comments
Try to run it with http://elixir-lang.org/docs/stable/mix/Mix.Tasks.Test.html#module-command-line-options |
I'm not sure how the
It printed 3 tests, but then reported the total number of tests as 103. |
@myronmarston maybe they are really good tests and Elixir is just giving you bonus points. 😅 |
@myronmarston it's a long shot, but do you have any skipped tests? I noticed this: |
@myronmarston the formatter that handles this output seems to work correctly, it's weird that it consistently or kind of consistently adds 100. More specifically it counts every test, even the skipped ones. So it might be that the |
Yes, we have some skipped tests, but we definitely do not have 100 and that's not what's going on here. When there are skipped tests, ExUnit includes the number in the summary. For example, here's the output for one of our other sub-apps:
Notice that there are 7 tests total, of which 1 was skipped. The summary line says "107 tests, 0 failures, 1 skipped". For the Overall, my test suite has 11 tests that are skipped by excluding |
I have tried to reproduce the issue but unfortunately I could not. More information or a mechanism that reproduces it is appreciated. |
Do you use some libraries that inject themselves into ex_unit? I know some property checking libraries used to mess up the test count. |
Thanks for the suggestion--this is definitely the problem. Our suite uses ExCheck and it is definitely causing the issue -- I commented out our use of it and the counts are reporting correctly now. Wish I could have realized it was at fault sooner :(. Thanks for looking into this and helping me figure it out! |
Environment
OS X El Capitan
Current behavior
I've occasionally noticed that
mix test
in my umbrella app produces results that greatly exaggerate the number of tests in some of the sub-apps. Here's the complete output from runningmix test
. Notice the results for several of these apps:3 dots -- but it said it ran 103 tests.
8 dots -- but it said it ran 108 tests.
In general, virtually all of the test counts seem to have an extra 100 for some reason. Note that when I
cd
into the directory for one of these apps, it reports the total correctly:Likewise, for
rankings_endpoint_models
, which was reported as having 606 tests from the umbrella root, it reports 506 tests when run directly from its directory.Digging in a little bit, it looks like all the apps listed before
common_models
reported their counts correctly, thencommon_models
reported 286 when the real number is 186, and every app run after that has its total inflated by 100. It's like the test count gets reset to 100 instead of 0 once one app has more than 100 tests (but I suspect the actual above is more nuanced than that...)Expected behavior
I expect ExUnit to correctly report the number of tests it ran :).
The text was updated successfully, but these errors were encountered: