Work around different versions of patch in unit tests

Review Request #10208 — Created Oct. 9, 2018 and submitted

brennie
Review Board
release-3.0.x
48a0ed7...
reviewboard

Review request https://reviews.reviewboard.org/r/10164/ landed on
release-4.0.x, but the underlying issue was introduced on release-3.0.x.
This patch is a backport of that patch. The original commit message
follows:

We had a unit test that depended on the specific version of patch
installed. Newer versions of patch will accept a diff that contains no
hunks, whereas older versions will fail with a message saying that the
input contained only garbage.

We now have unit tests that check the correct behaviour happens in both
cases by replacing our call to patch.

Ran unit tests.

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
chipx86
  1. 
      
  2. Why the "patch(1)"?

    1. I'm assuming this is to differentiate patch files from the patch binary the way man would do it, but that wouldn't be appropriate here. I'd say "with GNU patch ..." instead.

    2. We have no guarantee that it will be gnu patch. It could be BSD patch (im sure somewhere out there a dev is using review board on BSD)

      Also the other patch already has this. :/

    3. Let's say "patch tool" then. The other one can be fixed in merge.

  3. reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 1)
     
     
     
     
     
     
     
     

    We should be using keyword arguments for all PatchError calls. It's a complicated bunch of parameters.

  4. 
      
brennie
brennie
chipx86
  1. 
      
  2. Summary and description should be updated too.

  3. 
      
brennie
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (156c7ce)
Loading...