python3Packages.pytestCheckHook: fix Bash heredoc EOF outside subshell#403973
Conversation
Fix the unterminated here document of the pytest-check-hook.sh error mesage by moving the EOF of the here document between the parenthesis of the process substitution.
wolfgangwalther
left a comment
There was a problem hiding this comment.
I think we should add a test that covers the functionality inside the heredoc. This would then be a test that actually fails when anything like this breaks. Given that the whole subshell / kill etc. stuff is rather hacky, this would make me feel much better about it.
|
We seem to already have some test-cases, but at least one of them doesn't seem to work properly: Aka, why is the second one not failing? I guess we need to look for the error message that is actually returned from the python heredoc - otherwise it probably just fails later for some other reasons or so? |
|
Ok, this is confusing. Before this PR, I get this for the second test mentioned above (non existent glob): This very much looks like... the python code is actually running, despite the warning? Maybe the warning is actually false alarm... and we are "only" fixing the warning here, but not the actual feature. |
|
Oh my, I hate bash... So bash complains about the unterminated here-doc, but still proceeds to work perfectly fine with it. |
wolfgangwalther
left a comment
There was a problem hiding this comment.
Works for me to suppress the warning.
|
And for the record, |
I filed an issue (koalaman/shellcheck#3199) to ShellCheck, the missing (?) syntax checker for Bash. |
This PR fixes the unterminated here document of the
pytest-check-hook.sherror mesage by moving the EOF of the here document between the parenthesis of the process substitution.Context: #386513 (review)
The error it fixes is passed silently due to Bash's tolerance to errors inside prcess substitution subshell, but the error message is printed out to the build log.
Here's the partial build logs of
python3Packages.tests.basicbefore and after this fix:Before:
After:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.