Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional improvements to
kcov
test suite.tests: validate
testbase.configure
argumentsEnsure that all the paths in
testbase.configure
are not empty andnormalized.
Ensure that
outbase
is not the current working directory.tests: convert simple % style string format to f-string
Convert old formatting style to f-string style, using
python3 -m libcst.tool codemod convert_percent_format_to_fstring.ConvertPercentFormatStringCommand
tests: remove unnecessary call to
setUp
method.It is not necessary because
setUp
is called automatically byTestCase.run
.tests: use
skipTest
instead of print and returnUsing
skipTest
is the preferred method for skipping tests.Now the test message is printed on the same line.
tests: override
TestCase.tearDown
intestbase.py
Use
os.makedirs
to create thekcov
directory insetUp
andshutil.rmtree
to remove it in
tearDown
.Don't use the shell, since errors are not propagated.
Ensure the "kcov-kcov" directory uses a fixed path
In
ci.yml
,codecov
assumes that the output directory is"/tmp/kcov-kcov".
Don't assume that
outbase
is always "/tmp", and instead use the"/tmp/kcov-kcov" path.
NOTES
I used tools to automate refactoring, like
LibCST
andsed
.LibCTS codemod for converting old format to f-string unfortunately added parenthesis in some non simple statement. Only later I found that there was another tool
flynt
but I have not used it to see if there are differences in formatting.When removing calls to
setUp
method, I also inadvertently removed calls tosetUp
method inside thedoTest
method. This is fine, sincedoTest
is always called from therunTest
method sosetUp
is always called.TODO
I noted that
doShell
is used only two times; other code using the shell usesystem
.Additionally, both
doShell
andsystem
does not propagate errors, so I plan to make this more robust in a separate PR. I also plan to group shell commands, instead of spawning a subprocess for every command line.