• 
      

    Add unit tests for git-p4.

    Review Request #12649 — Created Sept. 27, 2022 and submitted

    Information

    RBTools
    release-4.x

    Reviewers

    The git-p4 support in GitClient lacked any real testing, which meant
    it regressed with Python 3. This also made it harder to iterate on. We
    had some fantastic work in recent contributions to extend the features
    of git-p4 diffs, but we couldn't reasonably ask for any unit tests to be
    written to prove the support works.

    This change introduces unit tests that cover get_repository_info() and
    diff() for git-p4. It avoids duplicating a lot of the core diff tests,
    but does cover all the Perforce-specific operations and multi-commit
    review requests.

    There's also a bit of cleanup to related tests in this file, to keep
    naming consistent.

    This is a precursor to work for optimizing and future-proofing this
    code.

    Unit tests pass.

    Summary ID
    Add unit tests for git-p4.
    The git-p4 support in `GitClient` lacked any real testing, which meant it regressed with Python 3. This also made it harder to iterate on. We had some fantastic work in recent contributions to extend the features of git-p4 diffs, but we couldn't reasonably ask for any unit tests to be written to prove the support works. This change introduces unit tests that cover `get_repository_info()` and `diff()` for git-p4. It avoids duplicating a lot of the core diff tests, but does cover all the Perforce-specific operations and multi-commit review requests. This is a precursor to work for optimizing and future-proofing this code.
    e1863406f17441097cf5ef986cb3a9c87a943e03
    Description From Last Updated

    'typing.Any' imported but unused Column: 1 Error code: F401

    reviewbotreviewbot

    too many blank lines (2) Column: 5 Error code: E303

    reviewbotreviewbot

    Change to GitClient.diff.

    maubinmaubin

    Change to GitClient.parse_revision_spec

    maubinmaubin

    Needs a Version Added:

    maubinmaubin
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    chipx86
    chipx86
    maubin
    1. 
        
    2. rbtools/clients/tests/test_git.py (Diff revision 3)
       
       
      Show all issues

      Change to GitClient.diff.

    3. rbtools/clients/tests/test_git.py (Diff revision 3)
       
       
      Show all issues

      Change to GitClient.parse_revision_spec

    4. rbtools/clients/tests/test_git.py (Diff revision 3)
       
       
      Show all issues

      Needs a Version Added:

    5. 
        
    chipx86
    maubin
    1. Ship It!
    2. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-4.x (e79a649)