It took me a while to realize what this video is about, but then it hit :D Very nice approach to detect dead test code!
@b_0rk3 күн бұрын
> codecov is too slow to be useful brother preach, codecov takes like 20 seconds to load a webpage to do the one thing 99% of us actually care about
@Th3K1ngK00p43 күн бұрын
All the solutions I've tried seem to be super slow. coveralls has the same problem in my experience
@TheAulto3 күн бұрын
Thanks! Another variation of code not being run is when you loop over an empty result set e.g. you query a test database, and run an assert on each result. But then the test data was updated and now your query returns nothing. So none of the asserts you’d make are run. The test is still technically correct, but is now prone to let the code it tests become incorrect, since it’s not actually checking anything.
@anthonywritescodeКүн бұрын
indeed! I was trying to find an example of that in the video but I couldn't find the particular file!
@jtw-r3 күн бұрын
0:12 Totally understand but I wonder if a better wording would be “100% branch/statement test coverage” or something like that? Am I conflating that with something different? Great video, my work codebase doesn’t have 100% file coverage (yet) but it seems like a no brainer to at least have 100% coverage on the things it IS testing, so I make sure that bare minimum is met.
@anthonywritescodeКүн бұрын
yeah the video is meant to be a tiny bit of wordplay
@daniel-mizsakКүн бұрын
Nice video! It made me think. Is there an easy way to require a certain percentage of coverage for tests and source code separately? Maybe using tox somehow? And if so would you recommend it?
@anthonywritescodeКүн бұрын
yep! you can use `coverage report --include 'tests/**' --fail-under 100`
@NostraDavid2Күн бұрын
That also means your tox settings can also just have "coverage report", so people can just run that, instead of constantly having to copy settings as well. But that's just my opinion.
@qexat3 күн бұрын
this video covered everything 🥁
@lakshman5872 күн бұрын
100% coverage 😅
@Chiny_w_Pigulce3 күн бұрын
Why shouldn't you use ls in shell script?
@mikeebrady3 күн бұрын
Pretty sure it is because the output format of ls is not standardized
@salchowlukas3 күн бұрын
When I use ls in shell scripts pycharm warns me "Use 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow non-alphanumeric filenames."
@anthonywritescodeКүн бұрын
the output format is not specified or machine readable (especially with spaces and special characters). `find ... -print0` is typically the way to go
@bozho.dimitrov3 күн бұрын
Amazing video. I was thinking about this the other day -- why would you want to keep around tests that never run :D It is like code dept ** 2