Page MenuHomePhabricator

Fix unit test coverage for `NoseTestEngine`.
ClosedPublic

Authored by joshuaspence on Mar 7 2014, 4:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 16, 4:27 AM
Unknown Object (File)
Thu, Aug 29, 7:16 PM
Unknown Object (File)
Thu, Aug 22, 8:16 PM
Unknown Object (File)
Thu, Aug 22, 8:16 PM
Unknown Object (File)
Thu, Aug 22, 8:16 PM
Unknown Object (File)
Thu, Aug 22, 7:16 PM
Unknown Object (File)
Aug 17 2024, 5:01 AM
Unknown Object (File)
Aug 15 2024, 12:15 AM

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

Lint
Lint Skipped
Unit
Tests Skipped

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.