← Back to issue list

`init` tox tests failing on macos 11

View original Github issue

Metadata

Project
charmcraft
Number
#1508
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

The macOS 11 init/tox failure was fixed by merged PR #1674 (commit b24ccd5b), which corrected tox environment handling and added a workaround for operator#1212.

Resolution: closed resolved

Reason: PR canonical/charmcraft#1674 was merged as commit b24ccd5b. It corrected tox environment variable handling and added a workaround for canonical/operator#1212, allowing initialized charms' tox tests to pass.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description On macos 11 (but not on Linux, Windows or macos 12), the tox tests after creating a charm fail. The failures appear to be about the path not being correctly set or something. ### To Reproduce On macos 11: 1. `charmcraft init` 2. `tox -v` See: https://github.com/canonical/charmcraft/actions/runs/7788640169/job/21238497566?pr=1507 ### Environment macos 11 ### charmcraft.yaml ```shell n/a ``` ### Relevant log output ```shell ___________________________ test_tox_success[simple] ___________________________ new_path = PosixPath('/Users/runner/work/charmcraft/charmcraft/.tox/tox_tmp/test-py3.10/pytest-of-runner/pytest-0/test_tox_success_simple_0') init_command = <charmcraft.application.commands.init.InitCommand object at 0x10b4c4520> profile = 'simple' @pytest.mark.slow() @pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows") @pytest.mark.skipif(bool(os.getenv("RUNNING_TOX")), reason="does not work inside tox") @pytest.mark.parametrize("profile", list(commands.init.PROFILES)) def test_tox_success(new_path, init_command, profile): # fix the PYTHONPATH and PATH so the tests in the initted environment use our own # virtualenv libs and bins (if any), as they need them, but we're not creating a # venv for the local tests (note that for CI doesn't use a venv) env = os.environ.copy() env_paths = [p for p in sys.path if "env/lib/python" in p] if env_paths: if "PYTHONPATH" in env: env["PYTHONPATH"] += ":" + ":".join(env_paths) else: env["PYTHONPATH"] = ":".join(env_paths) for path in env_paths: bin_path = path[: path.index("env/lib/python")] + "env/bin" env["PATH"] = bin_path + ":" + env["PATH"] init_command.run(create_namespace(profile=profile)) result = subprocess.run( ["tox", "-v"], cwd=new_path, env=env, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=False, ) if result.returncode != 0: > raise AssertionError( "".join(("Tox run failed:\n", *(f":: {line}" for line in result.stdout.splitlines()))) ) E AssertionError: Tox run failed: E :: format: find interpreter for spec PythonSpec(path=/Users/runner/work/charmcraft/charmcraft/.tox/.tox/bin/python):: format: proposed PythonInfo(spec=CPython3.12.1.final.0-64, system=/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12, exe=/Users/runner/work/charmcraft/charmcraft/.tox/.tox/bin/python, platform=darwin, version='3.12.1 (v3.12.1:2305ca5144, Dec 7 2023, 17:23:39) [Clang 13.0.0 (clang-1300.0.29.30)]', encoding_fs_io=utf-8-utf-8):: format: create virtual environment via CPython3Posix(dest=/Users/runner/work/charmcraft/charmcraft/.tox/format, clear=False, no_vcs_ignore=False, global=False):: format: add seed packages via FromAppData(download=False, pip=bundle, via=copy, app_data_dir=/Users/runner/Library/Application Support/virtualenv):: format: add activators for Bash, CShell, Fish, Nushell, PowerShell, Python:: format: install_deps> python -I -m pip install ruff:: format: exit 0 (3.08 seconds) /Users/runner/work/charmcraft/charmcraft/.tox/tox_tmp/test-py3.10/pytest-of-r /Users/runner/work/charmcraft/charmcraft/tests/integration/commands/test_init.py:253: AssertionError ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved The macOS 11 init/tox failure was fixed by merged PR #1674 (commit b24ccd5b), which corrected tox environment handling and added a workaround for operator#1212.
stealth/space-bunny-alpha — closed resolved Fixed by charmcraft#1674 (commit b24ccd5b), correcting tox environment setup and working around operator#1212 so initialized charms pass tox tests.
stealth/space-bunny-alpha — closed resolved Fixed in charmcraft#1674 (commit b24ccd5b): corrected the tox environment variable and added a workaround for canonical/operator#1212 so initialized charms pass tox tests.
qwen3.6-35b-a3b-mtp-q6 — — Closed without comments or linked resolution. The macOS 11 tox test failure during init was likely abandoned or resolved externally, as no fixes or discussions were documented.
qwen/qwen3.6-35b-a3b — — Closed without a documented fix or linked pull request, indicating the macOS 11 tox test failure was abandoned or resolved externally.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The macOS 11 tox test failure in charmcraft init was abandoned due to inactivity and lack of follow-up comments.
qwen3.6-35b-a3b-mtp-q6 — — Closed without comments or linked resolution. The macOS 11 tox test failure during charmcraft init appears abandoned. No fix or merge details provided.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#1674 (confidence 100%)

    Merged fix commit b24ccd5b resolved the failing initialized-charm tox tests.

  • Related To: canonical/charmcraft#1509 (confidence 98%)

    Commit 49be52f3 initially skipped the failing test on macOS 11 before the later fix.

  • Related To: operator#1212 (confidence 90%)

    The merged fix added a workaround for this underlying operator issue.

Related issues

Issue Project State Summary Similarity
#1509 test: ignore failing init test on macos 11 charmcraft merged Merged in commit 49be52f3 as a temporary macOS 11 init-test skip for #1508; the underlying tox failure was later fixed by #1674 (b24ccd5b).
82%
#1507 test: make init tox test more informative charmcraft merged Merged in canonical/charmcraft#1507 (commit 418e8ff7), adding detailed init tox-test output to diagnose macOS 11 failures in #1508.
75%
#1674 fix: make tox tests succeed charmcraft merged Merged in commit b24ccd5b: fixed the tox environment variable and added a workaround for canonical/operator#1212, allowing tox tests to succeed.
72%