• 
      

    Fix up various issues in RBTools tests.

    Review Request #10952 — Created March 13, 2020 and submitted

    Information

    RBTools
    release-2.0.x

    Reviewers

    There are a few issues that cropped up in the RBTools test suite,
    especially when running on Python 3:

    • A bad merge made it so we were no longer importing parse_qsl and
      urlparse where they were used.
    • Some assertions were checking that some data were six.text_type when
      they ought to have been checking for the native string type.
    • A typo had ItemResourceTests.tearDown calling the superclass'
      setUp method instead of tearDown.
    • hgsubversion tests haven't worked for a while (the test infrastructure
      overrides the .hgrc but the only way to install the hgsubversion
      extension is via .hgrc). Unfortunately some change made it so that
      after the setUpClass was called, if we then skipped the test, we'd end
      up with a bad cwd for the rest of the test suite, resulting in a bunch
      of broken tests. I haven't yet fixed this, but I have improved the way
      that tests are skipped when hgsubversion isn't available, resulting in
      both faster execution and avoiding the cwd problems.
    • In Python 3, re.split behaves somewhat differently when there's a
      * character in the regex. This was resulting in SVN path splitting
      creating a list with every single character split instead of properly
      splitting only on slashes. /+ is a more correct regex for this
      anyway.

    Ran unit tests on Python 2 and 3.

    Summary ID
    Fix up various issues in RBTools tests.
    There are a few issues that cropped up in the RBTools test suite, especially when running on Python 3: - A bad merge made it so we were no longer importing parse_qsl and urlparse where they were used. - Some assertions were checking that some data were `six.text_type` when they ought to have been checking for the native string type. - A typo had `ItemResourceTests.tearDown` calling the superclass' `setUp` method instead of `tearDown`. - hgsubversion tests haven't worked for a while (the test infrastructure overrides the .hgrc but the only way to install the hgsubversion extension is via .hgrc). Unfortunately some change made it so that after the setUpClass was called, if we then skipped the test, we'd end up with a bad cwd for the rest of the test suite, resulting in a bunch of broken tests. I haven't yet fixed this, but I have improved the way that tests are skipped when hgsubversion isn't available, resulting in both faster execution and avoiding the cwd problems. - In Python 3, `re.split` behaves somewhat differently when there's a `*` character in the regex. This was resulting in SVN path splitting creating a list with every single character split instead of properly splitting only on slashes. `/+` is a more correct regex for this anyway. Testing Done: Ran unit tests on Python 2 and 3.
    a24fb4b8a353db3efef1035177e27508cfb34988
    Description From Last Updated

    These could just go on the class itself.

    chipx86chipx86

    This can probably just be: cls._skip_reason = \ 'hgsubverison ...' Avoids the string wrapping.

    chipx86chipx86
    chipx86
    1. Ship It!
    2. 
        
    david
    chipx86
    1. 
        
    2. rbtools/clients/tests/test_mercurial.py (Diff revisions 1 - 2)
       
       
       
       
      Show all issues

      These could just go on the class itself.

    3. rbtools/clients/tests/test_mercurial.py (Diff revisions 1 - 2)
       
       
       
      Show all issues

      This can probably just be:

      cls._skip_reason = \
          'hgsubverison ...'
      

      Avoids the string wrapping.

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