This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tools/freeze needs tests in the test suite.
Type: Stage: resolved
Components: Demos and Tools Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.snow Nosy List: eric.snow, gregory.p.smith, lemburg
Priority: normal Keywords: patch

Created on 2021-10-27 15:42 by eric.snow, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29222 merged eric.snow, 2021-10-27 15:42
PR 31094 merged gregory.p.smith, 2022-02-03 04:53
Messages (3)
msg405105 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-10-27 15:42
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).
msg405197 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-10-28 16:14
New changeset 13d9205f4057eeeef80a25d410ad123876dc60cd by Eric Snow in branch 'main':
bpo-45629: Add a test for the "freeze" tool. (gh-29222)
https://github.com/python/cpython/commit/13d9205f4057eeeef80a25d410ad123876dc60cd
msg412421 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-02-03 05:36
New changeset 8726067ace98a27557e9fdf1a8e1c509c37cfcfc by Gregory P. Smith in branch 'main':
bpo-45629: Improve test.support.skip_if_buildbot (GH-31094)
https://github.com/python/cpython/commit/8726067ace98a27557e9fdf1a8e1c509c37cfcfc
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89792
2022-02-03 05:36:25gregory.p.smithsetmessages: + msg412421
2022-02-03 04:53:56gregory.p.smithsetnosy: + gregory.p.smith

pull_requests: + pull_request29280
2021-10-28 16:15:24eric.snowsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-10-28 16:14:45eric.snowsetmessages: + msg405197
2021-10-27 15:42:55eric.snowsetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request27506
2021-10-27 15:42:12eric.snowcreate