When running ./test/lint/lint-all.py, the script runs all tests but
also calls itself because the comparison with __file__ doesn't work.
Comparing resolved paths gives reliable comparison, and lint-all.py doesn't call itself any more
When running ./test/lint/lint-all.py, the script runs all tests but
also calls itself because the comparison with __file__ doesn't work.
Comparing resolved paths gives reliable comparison, and lint-all.py doesn't call itself any more
Concept ACK. Good catch!
It doesn't run twice in CI, right? For example, looking at https://cirrus-ci.com/task/4523243527733248?logs=lint#L849 I can only find the error once.
Ah, in 06_script.sh lint-all.py is started with test/lint/lint-all.py, but I am starting it locally with ./test/lint/lint-all.py. I think the leading ./ is the difference
May I propose a different solution: to rename the launcher so that it doesn't match the glob. This is 100% reliable and imo more elegant.
Yeah, could rename to all-lint.py and then also address #24982 (review) while touching this file?
That way it is impossible for the script to call itself.
Removed th check against __file__ which is not necessary any more after the rename to all-lint.py.
Changed glob to find only `lint-*.py` scripts.
Code review ACK f26a496dfd0a7ce3833a10075027d7d5b0345e32
Post-merge ACK