stopping xargs early (intermediate) anthony explains
Vložit
- čas přidán 7. 09. 2024
- today we talk about a debugging technique using xargs -- and making it stop on the first failure
- xargs: • all about xargs ! (beg...
playlist: • anthony explains
==========
twitch: / anthonywritescode
dicsord: / discord
twitter: / codewithanthony
github: github.com/aso...
stream github: github.com/ant...
I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
pytest has an option to stop on the first failure: "pytest -x". However, I can see where being able to do this from a text file is useful. Like the example, when a test is depending on the state set by a previous test.
in particular I was hunting for tests that failed on their own so --maxfail wasn't helpful (I'm a pytest core dev)
That little comment at the end got me ❤😂
Interesting :) I should remember to use xargs more. I tend to use loops for this type of stuff.
In this case a for loop might be easy to break out of on a failing test though. Something like this:
for test in `pytest --collect-only -q`; do pytest -qq $test || break; done
Only chokes on the garbage at the bottom but then it's done testing anyways.
That's a good thing to know!
This is a great little trick
very useful - thanks !
Very cool! Didn't know thanks :)
Hello!
Wow, that sucks. Why is xargs ignoring all other failing error codes by default? Why is xargs treating 255 in any special way? Why is there no way to configure which exit codes result in which behaviour? Things like these is why I hate (ba)sh with a passion.
I swear, if bash didn't have a monopoly on the "scripting language available out of the box on any *nix system" market, nobody sane would actually use this dumpster fire of a language/environment. The "Unix philosophy" is so focused on "do one thing" that they forgot to "do it well".