Page MenuHomePhabricator

Expand Differential test coverage to include moves, shields, and more
ClosedPublic

Authored by epriestley on Mar 5 2015, 12:54 AM.
Tags
None
Referenced Files
F14372664: D11970.diff
Fri, Dec 20, 8:02 PM
Unknown Object (File)
Tue, Dec 17, 1:19 PM
Unknown Object (File)
Tue, Dec 17, 6:49 AM
Unknown Object (File)
Fri, Dec 13, 9:51 PM
Unknown Object (File)
Tue, Dec 10, 9:07 AM
Unknown Object (File)
Sun, Dec 8, 3:57 PM
Unknown Object (File)
Fri, Dec 6, 2:13 PM
Unknown Object (File)
Thu, Dec 5, 8:30 PM
Subscribers
Tokens
"Mountain of Wealth" token, awarded by btrahan.

Details

Summary

See D11468 and D11465. Fixes T5163. Fixes T4105. This makes it practical to test shields, unshielding, moves, etc.

This fixes the issue in D11468, where line maps from whitespace-ignored hunks could have fewer lines than line maps from whitespace-respected hunks, causing a warning.

This encodes the behavior which D11465 changed, making it the canon behavior. Specifically, we do not show a shield. I think this is correct. It seems misleading to show "the contents of this file were not changed", because they were changed in both the sense that the file was completely removed, and also changed in the sense that the content itself was (or may have been) changed at the destination. Instead, we just show nothing.

Test Plan
  • Added test coverage.
  • Ran tests.
  • Used arc diff --raw --browse to verify that web behavior was consistent with CLI/test behavior.

Diff Detail

Repository
rP Phabricator
Branch
diff2
Lint
Lint Warnings
Unit
Tests Passed
Build Status
Buildable 4749
Build 4765: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Expand Differential test coverage to include moves, shields, and more.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, joshuaspence.

I haven't had a good chance to look at this yet, but here are two comments that I have so far.

src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
70

Maybe rename this to buildChangesetParsers.

96

Maybe phtize this while you're here.

epriestley edited edge metadata.
  • Rename method.
  • pht()
  • Actually fix the moved file issue.

Specifically, since "moved" files count as "deleted", we were skipping preprocessing on them. This caused them to have no rendered content. If we comment out the early bailout, we get a boring/useless diff (albeit, not a broken one) where the whole file is red.

Instead, just render them with an empty "shield" so you can't reveal the content, even if it exists.

btrahan edited edge metadata.

awesometown

src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
82

I think you should rebuild the parsers each test rather than doing this.

This revision is now accepted and ready to land.Mar 5 2015, 9:13 PM
epriestley edited edge metadata.
  • Remove clone cheating in unit test.
This revision was automatically updated to reflect the committed changes.