Closed perillo closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 65.68%. Comparing base (
5ae73ae
) to head (505cb60
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Beautiful! Thanks a lot for taking on the testsuite!
Thanks to you for the review.
Additional improvements to
kcov
test suite.[x] tests: validate
testbase.configure
argumentsEnsure that all the paths in
testbase.configure
are not empty and normalized.Ensure that
outbase
is not the current working directory.[x] 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
[x] tests: remove unnecessary call to
setUp
method.It is not necessary because
setUp
is called automatically byTestCase.run
.[x] 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.[x] tests: override
TestCase.tearDown
intestbase.py
Use
os.makedirs
to create thekcov
directory insetUp
andshutil.rmtree
to remove it intearDown
.Don't use the shell, since errors are not propagated.
[x] 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.