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

Running tox-current-env tests with --current-env fails #79

Open
mtelka opened this issue Sep 4, 2024 · 2 comments
Open

Running tox-current-env tests with --current-env fails #79

mtelka opened this issue Sep 4, 2024 · 2 comments

Comments

@mtelka
Copy link

mtelka commented Sep 4, 2024

When I run tox-current-env tests with --current-env then I see many tests to fail:

=========================== short test summary info ============================
FAILED tests/test_integration_tox4.py::test_recreate_environment[--print-deps-to=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[True---print-extras-to=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[True---current-env] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[False---print-deps-to=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_recreate_environment[--current-env] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[False---current-env] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[False---print-extras-to=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[False] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[True] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_passenv[None] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_passenv[different list] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_passenv[__var] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_passenv[*] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_self_is_not_installed[True---print-deps-to=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_pass_env[None] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_pass_env[*] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_pass_env[different\nlist] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_pass_env[__var] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_report_installed - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
FAILED tests/test_integration_tox4.py::test_regular_run_native_toxenv - subprocess.CalledProcessError: Command '('/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python', '-m', 'tox', '-q', '-e', 'py39')' returned non-zero exit status 255.
FAILED tests/test_integration_tox4.py::test_print_deps_without_python_command[--print-deps-to-file=-] - FileNotFoundError: [Errno 2] No such file or directory: '/data/builds/oi-userland/components/python/tox-current-env/build/amd64-3.9/.tox/py39/bin/python'
======= 21 failed, 164 passed, 2 skipped, 1 xfailed in 84.83s (0:01:24) ========

I found that when I do this:

--- tox-current-env-0.0.12/tests/test_integration_tox4.py.orig
+++ tox-current-env-0.0.12/tests/test_integration_tox4.py
@@ -347,6 +347,7 @@
     tox_path = shutil.which("tox")
     tox_link.symlink_to(tox_path)
     env = {**os.environ, "PATH": str(bin)}
+    del env["TOX_WORK_DIR"]
 
     result = tox("-e", NATIVE_TOXENV, print_deps_stdout_arg, env=env)
     expected = textwrap.dedent(

then all tests pass:

============ 185 passed, 2 skipped, 1 xfailed in 103.86s (0:01:43) =============
@hroncok
Copy link
Member

hroncok commented Sep 4, 2024

Running tox-current-env tests with --current-env is explicitly not expected to work and this is written in README.

That said, I wonder how removing TOX_WORK_DIR makis it work :/

@mtelka
Copy link
Author

mtelka commented Sep 4, 2024

It looks like the tox("-e", NATIVE_TOXENV, print_deps_stdout_arg, env=env) call removes .tox/py39/bin in the TOX_WORK_DIR and so all tests executed after this call simply fail. I've no idea why this particular tox() call removes the bin dir while all other tox() calls executed in tox-current-env test suite are okay. Maybe in all other tox() calls there is no TOX_WORK_DIR set?

I know that running tox-current-env tests with --current-env is discouraged, but since it mostly pass I think it is worth trying to make it fully working.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants