Page MenuHomePhabricator

Fix unit test coverage for `NoseTestEngine`.
ClosedPublic

Authored by joshuaspence on Mar 7 2014, 4:21 AM.
Tags
None
Referenced Files
F14080925: D8433.diff
Fri, Nov 22, 5:27 PM
Unknown Object (File)
Mon, Nov 18, 10:58 PM
Unknown Object (File)
Tue, Nov 12, 11:28 PM
Unknown Object (File)
Sat, Nov 9, 7:59 PM
Unknown Object (File)
Sat, Oct 26, 6:18 PM
Unknown Object (File)
Oct 23 2024, 6:30 AM
Unknown Object (File)
Oct 15 2024, 10:43 AM
Unknown Object (File)
Sep 26 2024, 4:40 PM

Details

Summary

I noticed that code coverage wasn't showing in Differential for
some repositories that we are using with Phabricator.

arc unit would should unit test coverage, but the paths were messy
(for example, .//foo/bar.py instead of foo/bar.py). As a result,
the code coverage info wasn't recognised as being for the correct
module.

I'm not sure why this logic is the way that it is... perhaps this is to
do with an older version of nose (I am using v1.3.0).

Test Plan

I created a diff for an internal repository that we have, and
observed that code coverage was displayed in Differential.

Diff Detail

Repository
rARC Arcanist
Branch
nose_test_engine
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

Adding some people who might have a better understanding of this than I do, but this seems sensible to me. If this actually breaks anything, give me a quick example of how to reproduce the break and we can get it covered in tests (we have far more ability to do things like mock fake projects now than we probably did when this stuff was written).

epriestley edited edge metadata.
This revision is now accepted and ready to land.Mar 7 2014, 6:15 PM
src/unit/engine/NoseTestEngine.php
133

Oh, I'm going to change this to:

phutil_split_lines(Filesystem::readFile($path))

...which should work better in more cases and raise clearer errors in cases where it doesn't work.