Skip to content

Tools/freeze needs tests in the test suite. #89792

Description

@ericsnowcurrently
BPO 45629
Nosy @malemburg, @gpshead, @ericsnowcurrently
PRs
  • bpo-45629: Add a test for the "freeze" tool. #29222
  • bpo-45629: Improve test.support.skip_if_buildbot #31094
  • 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 = 'https://github.com/ericsnowcurrently'
    closed_at = <Date 2021-10-28.16:15:24.348>
    created_at = <Date 2021-10-27.15:42:12.541>
    labels = ['3.11']
    title = 'Tools/freeze needs tests in the test suite.'
    updated_at = <Date 2022-02-03.05:36:25.402>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2022-02-03.05:36:25.402>
    actor = 'gregory.p.smith'
    assignee = 'eric.snow'
    closed = True
    closed_date = <Date 2021-10-28.16:15:24.348>
    closer = 'eric.snow'
    components = ['Demos and Tools']
    creation = <Date 2021-10-27.15:42:12.541>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45629
    keywords = ['patch']
    message_count = 3.0
    messages = ['405105', '405197', '412421']
    nosy_count = 3.0
    nosy_names = ['lemburg', 'gregory.p.smith', 'eric.snow']
    pr_nums = ['29222', '31094']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45629'
    versions = ['Python 3.11']

    Linked PRs

    Activity

    1. ericsnowcurrently commented on Oct 27, 2021

      @ericsnowcurrently
      MemberAuthor

      I found that Tools/freeze doesn't get tested. It has a "test" directory but it's more of a rudimentary sanity check that must be run manually. Since the tool isn't tested through our test suite, there's a high likelihood it can get broken without anyone realizing it. The risk has increased with recent changes to frozen modules. So such tests would be valuable.

      The tool requires that Python be installed. In the context of our test suite, this means configuring with a temp dir prefix and then re-building. We must do it in a separate directory to avoid affecting other tests.

      I'm planning on adding a test that does the following:

      1. create a temp dir (TMPDIR)
      2. copy the repo to TMPDIR/cpython
      3. run configure there with --prefix=TMPDIR/python-installation
      4. run make -j
      5. run make install -j
      6. write a simple script to TMPDIR/app.py
      7. run the "freeze" tool on it, with minimal options
      8. run the frozen app and verify it worked

      Note that there needs to be enough disk space for all that (which not all buildbots have). Also, the test will be relatively slow due to having to re-build.

      There aren't any other tests that re-build Python or the like, so I'm a little hesitant to set precedent. Perhaps that's why there weren't any tests already. However, I don't see any significant reasons to not add the test (as long as it doesn't lead to spurious failures).

    2. ericsnowcurrently commented on Oct 28, 2021

      @ericsnowcurrently
      MemberAuthor

      New changeset 13d9205 by Eric Snow in branch 'main':
      bpo-45629: Add a test for the "freeze" tool. (gh-29222)
      13d9205

    3. gpshead commented on Feb 3, 2022

      @gpshead
      Member

      New changeset 8726067 by Gregory P. Smith in branch 'main':
      bpo-45629: Improve test.support.skip_if_buildbot (GH-31094)
      8726067

    4. transferred this issue fromon Apr 10, 2022
    5. added a commit that references this issue on Feb 12, 2023
    6. added 2 commits that reference this issue on Feb 12, 2023
    7. added 2 commits that reference this issue on Feb 12, 2023
    8. added 2 commits that reference this issue on Feb 12, 2023
    9. added a commit that references this issue on Feb 13, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.11only security fixes

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions