New submission from Eric Snow <ericsnowcurren...@gmail.com>:

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).

----------
assignee: eric.snow
components: Demos and Tools
messages: 405105
nosy: eric.snow, lemburg
priority: normal
severity: normal
stage: test needed
status: open
title: Tools/freeze needs tests in the test suite.
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45629>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to