force `subprocess.run` to check return code is 0
In general, this should help to capture unintentional errors.
Where the change has created failures, they have been fixed. (Mostly because the git repository that was looked for was missing.)
Merge request reports
Activity
Hypothesis: tests fail because we try to get the branch name from the git repository in which the mpsd-software-enviroment.py file sits (https://gitlab.gwdg.de/mpsd-cs/mpsd-software-environments/-/blob/force-checking-of-error-code/mpsd-software-environment.py#L90). When pytest executes the tests somewhere in
/tmp/pytest-...
it has no git repository, and thus the command fails.Once the hypothesis is confirmed, we have multiple options:
- never check if the git command fails (that's the current scenario on the master branch, but I don't like it as it may hide other problems)
- tell the function when we call it that this is a test and it shouldn't worry if git fails (or not even attempt to run it)
- let the function find out that we are in a test mode (somehow, there are multiple options) and ignore the error if we are in testing mode.
Your hypothesis is correct, I had previously debugged for the
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Message that you usually see in the tests, I ignored them as they would work properly when run on as a command and not via tests or via standalone file outside of the repo)added 1 commit
- 09d9f633 - refactor: we may need this function to create a git repo again.
added 7 commits
-
bc654227...b5402380 - 6 commits from branch
linux-debian11
- 89daab7b - Merge branch 'linux-debian11' into force-checking-of-error-code
-
bc654227...b5402380 - 6 commits from branch
added 1 commit
- 2a83123b - Create git repositories where they were missing
requested review from @akarnad
added 28 commits
-
a329bef1...021b9c15 - 27 commits from branch
linux-debian11
- 5a582e36 - Merge branch 'linux-debian11' into 'force-checking-of-error-code'
-
a329bef1...021b9c15 - 27 commits from branch
Merge conflicts are fixed @akarnad
I did that too but on https://gitlab.gwdg.de/mpsd-cs/mpsd-software-environments/-/merge_requests/17!
added 25 commits
- 38fa0d2c...3ee1179a - 15 earlier commits
- 36a78cc3 - fix pydocstyle and typo
- d85bc23b - show version of pycodestyle
- 721c546e - Merge branch 'split-installation-tests' of...
- 29d49692 - Merge branch 'force-checking-of-error-code' into 'split-installation-tests'
- 049e0c54 - fix last commit: meant pydocstyle not pycodestyle
- 4aef16e1 - Merge branch 'split-installation-tests' of...
- 7c57848c - update doc string of test_install_environment_zlib
- 0e860fe8 - remove redundant argument
- e6514ae5 - reformat with black
- 0564eb6d - Merge branch 'split-installation-tests' into 'force-checking-of-error-code'
Toggle commit list- Resolved by Hans Fangohr