Commit Graph

7 Commits (main)

Author SHA1 Message Date
Stefano Rivera 26e3f8c52e Exit non-zero if the tests fail
Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
3 years ago
Stefano Rivera 34b26f4026 Break the actual test runner into its own script
So that we don't have to run with coverage if we don't want to.

Additionally, don't require being in the t directory to run tests

Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
3 years ago
Elijah Newren 64aa9359ed run_coverage: prefer coverage3 to python3-coverage
Some of the systems I ran on had a 'python3-coverage' and some had a
'coverage3' program.  More were of the latter name, but more
importantly, the upstream tarball only creates the latter name;
apparently the former was just added by some distros.  So, switch to the
more official name of the program.

Signed-off-by: Elijah Newren <newren@gmail.com>
5 years ago
Elijah Newren 904e03f963 filter-repo: workaround Windows' insistence that command args be strings
It appears that in addition to Windows requiring cwd be a string (and
not a bytestring), it also requires the command line arguments to be
unicode strings.  This appears to be a python-on-Windows issue at the
surface (attempts to quote things that assumes the arguments are all
strings), but whether it's solely a python-on-Windows issue or there is
also a deeper Windows issue, we can workaround this brain-damage by
extending the SubprocessWrapper slightly.  As with the cwd changes, only
apply this on Windows and not elsewhere because there are perfectly
legitimate reasons to pass non-unicode parameters (e.g. filenames that
are not valid unicode).

Signed-off-by: Elijah Newren <newren@gmail.com>
5 years ago
Elijah Newren f2729153fe filter-repo: workaround Windows' insistence that cwd not be a bytestring
Unfortunately, it appears that Windows does not allow the 'cwd' argument
of various subprocess calls to be a bytestring.  That may be functional
on Windows since Windows-related filesystems are allowed to require that
all file and directory names be valid unicode, but not all platforms
enforce such restrictions.  As such, I certainly cannot change
   cwd=directory
to
   cwd=decode(directory)
because that could break on other platforms (and perhaps even on Windows
if someone is trying to read a non-native filesystem).  Instead, create
a SubprocessWrapper class that will always call decode on the cwd
argument before passing along to the real subprocess class.  Use these
wrappers on Windows, and do not use them elsewhere.

Signed-off-by: Elijah Newren <newren@gmail.com>
5 years ago
Elijah Newren effcd5b9ff filter-repo (python3): convert run_coverage
Signed-off-by: Elijah Newren <newren@gmail.com>
5 years ago
Elijah Newren 0e4d48158f filter-repo: add a script to generate a line coverage report
This also generates line coverage statistics for t/t9391/*.py, but the
point is line coverage of git-filter-repo.

Signed-off-by: Elijah Newren <newren@gmail.com>
5 years ago