Skip to content

Out-of-tree builds skip test_embed on GitHub #93336

Closed as not planned
Closed as not planned
@neonene

Description

@neonene

Currently, out-of-tree builds pass test_embed.py without checking on a GHA (ubuntu). This issue can be linked to gh-89858 and may already be known.

Messages without -W test option:

test_audit (test.test_embed.AuditingTests.test_audit) ... skipped 
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"

test_audit_run_command (test.test_embed.AuditingTests.test_audit_run_command) ... skipped
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"

test_audit_run_file (test.test_embed.AuditingTests.test_audit_run_file) ... skipped
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"
...

They come from support.REPO_ROOT below which points /home/runner/work/cpython/cpython-ro-srcdir. One test failure was left when I set /home/runner/work/cpython/cpython-builddir instead:

exepath = os.path.join(builddir, 'Programs')
expecteddir = os.path.join(support.REPO_ROOT, 'Programs')
self.test_exe = exe = os.path.join(exepath, exename)
if exepath != expecteddir or not os.path.exists(exe):
self.skipTest("%r doesn't exist" % exe)

TEST_SUPPORT_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_HOME_DIR = os.path.dirname(TEST_SUPPORT_DIR)
STDLIB_DIR = os.path.dirname(TEST_HOME_DIR)
REPO_ROOT = os.path.dirname(STDLIB_DIR)

FAIL: test_init_pybuilddir (test.test_embed.InitConfigTests.test_init_pybuilddir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 1356, in test_init_pybuilddir
    self.check_all_configs("test_init_compat_config", config,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 801, in check_all_configs
    self.check_config(configs, expected_config)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 727, in check_config
    self.assertEqual(config, expected)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'_co[351 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1304 chars]': 0} != {'_co[351 chars]'], 'orig_argv': [], 'xoptions': [], 'warnopti[1296 chars]': 0}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   '_isolated_interpreter': 0,
   'argv': [''],
   'base_exec_prefix': '/usr/local',
   'base_executable': '/tmp/tmp9etrf77o/_testembed',
   'base_prefix': '/usr/local',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': 1,
   'configure_c_stdio': 0,
   'dev_mode': 0,
   'dump_refs': 0,
   'exec_prefix': '/usr/local',
   'executable': '/tmp/tmp9etrf77o/_testembed',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': None,
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'interactive': 0,
   'isolated': 0,
   'malloc_stats': 0,
   'module_search_paths': ['/usr/local/lib/python312.zip',
                           '/home/runner/work/cpython/cpython-ro-srcdir/Lib',
                           '/home/runner/work/cpython/cpython-builddir/build/lib.linux-x86_64-3.12-pydebug',
                           '/usr/local/lib/python312.zip',
-                          '/tmp/cpython-ro-srcdir/Lib',
?                                ^ ^ ^ -----------

+                          '/tmp/tmp9etrf77o/Lib',
?                                ^^ ^^ ^^^^

                           '/tmp/tmp9etrf77o/libdir'],
   'module_search_paths_set': 1,
   'optimization_level': 0,
   'orig_argv': [],
   'parse_argv': 0,
   'parser_debug': 0,
   'pathconfig_warnings': 1,
   'platlibdir': 'lib',
   'prefix': '/usr/local',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': '/usr/local/lib/python312.zip:/home/runner/work/cpython/cpython-ro-srcdir/Lib:/home/runner/work/cpython/cpython-builddir/build/lib.linux-x86_64-3.12-pydebug',
   'quiet': 0,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'safe_path': 0,
   'show_ref_count': 0,
   'site_import': 1,
   'skip_source_first_line': 0,
-  'stdlib_dir': '/tmp/cpython-ro-srcdir/Lib',
+  'stdlib_dir': '/tmp/tmp9etrf77o/Lib',
   'tracemalloc': 0,
   'use_environment': 1,
-  'use_frozen_modules': 0,
?                        ^

+  'use_frozen_modules': False,
?                        ^^^^^

   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warn_default_encoding': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions