Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regrtest to receive a file with test (and subtests) to ignore #82138

Closed
pablogsal opened this issue Aug 27, 2019 · 11 comments
Closed

Allow regrtest to receive a file with test (and subtests) to ignore #82138

pablogsal opened this issue Aug 27, 2019 · 11 comments
Labels
3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@pablogsal
Copy link
Member

BPO 37957
Nosy @vstinner, @serhiy-storchaka, @pablogsal
PRs
  • bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore #16989
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2019-08-27.00:03:54.483>
    labels = ['type-feature', 'tests', '3.9']
    title = 'Allow regrtest to receive a file with test (and subtests) to ignore'
    updated_at = <Date 2020-04-14.23:05:24.243>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2020-04-14.23:05:24.243>
    actor = 'vstinner'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2019-08-27.00:03:54.483>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37957
    keywords = ['patch']
    message_count = 11.0
    messages = ['350584', '350601', '350606', '350607', '350617', '350626', '357006', '357015', '357016', '366411', '366460']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'pablogsal']
    pr_nums = ['16989']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37957'
    versions = ['Python 3.9']

    @pablogsal
    Copy link
    Member Author

    When building Python in some uncommon platforms (I am looking at you Solaris and AIX) there are some known tests that will fail. Right now, regrtest has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter.

    The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept.

    The problem with -x is that is not easy to ignore just a subtests that fail and the whole tests needs to be ignored.

    So I suggest to add a new command line option similar to --matchfile but the other way around. Another possibility is allowing to reverse the meaning of the matchfile argument, but I find that a bit more confusing.

    @pablogsal pablogsal added 3.8 only security fixes 3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Aug 27, 2019
    @vstinner
    Copy link
    Member

    I'm fine with adding an --excludefile=filename option to regrtest. Do you want to try to implement it? A test can be added in test_regrtest.

    @serhiy-storchaka
    Copy link
    Member

    Tests that fail on some platforms can be marked to skip in code.

    For example:

    @unittest.skipIf(sys.platform.startswith('aix'),
                     'bpo-29972: broken test on AIX')
    def test_strcoll_with_diacritic(self):
        self.assertLess(locale.strcoll('à', 'b'), 0)
    

    @vstinner
    Copy link
    Member

    Tests that fail on some platforms can be marked to skip in code.

    We provide best-effort support for AIX, but I consider that Solaris is no longer supported, and so I would prefer to avoid code specific to Soliars in the Python source code. Except if Pablo wants to provide again best-effort support for Solaris?
    https://pythondev.readthedocs.io/platforms.html

    @pablogsal
    Copy link
    Member Author

    Tests that fail on some platforms can be marked to skip in code.

    One of the use cases of this feature is for people to package Python at distributions or companies and want to run the test suite without modifying the code or applying patches.

    @vstinner
    Copy link
    Member

    FYI in the past, Fedora and RHEL packages skipped multiple tests using downstream patches. Hopefully, we managed to reenable almost all tests.

    Currently in Fedora, the python3 package use regrtest -x to skip some tests:

    # Run the upstream test suite
    # test_gdb skipped on s390x:
    # https://bugzilla.redhat.com/show_bug.cgi?id=1678277
    # test_gdb skipped everywhere:
    # https://bugzilla.redhat.com/show_bug.cgi?id=1734327
    # test_distutils
    # distutils.tests.test_bdist_rpm tests fail when bootstraping the Python
    # package: rpmbuild requires /usr/bin/pythonX.Y to be installed
    LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
    -wW --slowest -j0 \
    %if %{with bootstrap}
    -x test_distutils \
    %endif
    -x test_gdb \
    %ifarch %{mips64}
    -x test_ctypes \
    %endif

    https://src.fedoraproject.org/rpms/python3/blob/master/f/python3.spec

    We could only skip some test methods, but it's simpler for us to skip a whole test file.

    @pablogsal
    Copy link
    Member Author

    New changeset e0cd8aa by Pablo Galindo in branch 'master':
    bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989)
    e0cd8aa

    @pablogsal pablogsal removed the 3.8 only security fixes label Nov 19, 2019
    @vstinner
    Copy link
    Member

    I'm trying to keep regrtest in sync between 3.7, 3.8 and master branches. Maybe backport this change to 3.7 and 3.8 branches once buildbots validated the change? I'm keeping them in sync mostly to make bugfixes easier, but also to make my life easier when I debug issues in 3.7 or 3.8 branch.

    @pablogsal
    Copy link
    Member Author

    Ok, I reopen until the backports

    @pablogsal pablogsal reopened this Nov 20, 2019
    @vstinner
    Copy link
    Member

    New changeset 67b8a1f by Victor Stinner in branch '3.8':
    [3.8] Update libregrtest from master (GH-19516)
    67b8a1f

    @vstinner
    Copy link
    Member

    New changeset b894b66 by Victor Stinner in branch '3.7':
    Update libregrtest from master (GH-19517)
    b894b66

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants