
























And this fix should be available as version v3.31.1 soon. Thanks for reporting, that was a non-trivial find!
@PawelLipski that did the trick - the test is passing now on the branch. Thanks a lot!
Okay! I think what's special about your setup is that you've got git config core.editor set to nano. I'm now clearing that git config key before the affected tests... pls pull debug/test-edit-aur and run tox -e py -- -k test_edit -rP
@PawelLipski apologies, I missed the part about checking out that branch. Here's the redacted output:
py: install_deps> pip install -r [path to repo]/tmp/git-machete/requirements/testenv.txt
py: commands[0]> mkdir -p test-results/
py: commands[1]> python -m pytest -p tests.pytest_full_operands --numprocesses=auto --junitxml=test-results/testenv-py.xml -m 'not completion_e2e' -k test_edit_editor -vv
============================================================ test session starts ============================================================
platform linux -- Python 3.12.7, pytest-8.3.4, pluggy-1.5.0 -- [path to repo]/tmp/git-machete/.tox/py/bin/python
cachedir: .tox/py/.pytest_cache
rootdir: [path to repo]/tmp/git-machete
configfile: tox.ini
plugins: clarity-1.0.1, mock-3.14.0, xdist-3.6.1
20 workers [1 item]
scheduling tests via LoadScheduling
tests/test_edit.py::TestEdit::test_edit_editor
[gw0] [100%] FAILED tests/test_edit.py::TestEdit::test_edit_editor
================================================================= FAILURES ==================================================================
_________________________________________________________ TestEdit.test_edit_editor _________________________________________________________
[gw0] linux -- Python 3.12.7 [path to repo]/tmp/git-machete/.tox/py/bin/python
self = <tests.test_edit.TestEdit object at 0x75a47a2d50d0>
def test_edit_editor(self) -> None:
self.repo_sandbox.set_git_config_key("advice.macheteEditorSelection", "false")
with overridden_environment(GIT_MACHETE_EDITOR=" ", GIT_EDITOR="lolxd-this-doesnt-exist", VISUAL="", EDITOR=dummy_editor):
> assert_success(["edit", "--debug"], "")
[path to repo]/tmp/git-machete/tests/test_edit.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cmd_and_args = ['edit', '--debug'], expected_result = ''
def assert_success(cmd_and_args: Iterable[str], expected_result: str) -> None:
if expected_result.startswith("\n"):
# removeprefix is only available since Python 3.9
expected_result = expected_result[1:]
expected_result = textwrap.dedent(expected_result)
actual_result = re.sub(" +$", "", textwrap.dedent(launch_command(*cmd_and_args)), flags=re.MULTILINE)
> assert actual_result == expected_result
E AssertionError: assert == failed. [pytest-clarity diff shown]
E
E LHS vs RHS shown below
E
E >>> git -c log.showSignature=false config --list --null
E <stdout>:
E user.name
E [name]user.email
E [email]user.signingkey
E [key]gui.editor
E codediff.tool
E kdiff3merge.tool
E kdiff3core.editor
E nanoinit.defaultbranch
E mainpush.autosetupremote
E truecore.repositoryformatversion
E 0core.filemode
E truecore.bare
E falsecore.logallrefupdates
E trueuser.email
E tester@test.comuser.name
E Tester Testremote.origin.url
E /tmp/tmppbo8a79n/remoteremote.origin.fetch
E +refs/heads/*:refs/remotes/origin/*advice.macheteeditorselection
E falselog.showsignature
E false
E >>> git -c log.showSignature=false rev-parse --git-dir
E <stdout>:
E .git
E
E __get_editor_with_args(): '$GIT_MACHETE_EDITOR' shlexes into an empty list
E __get_editor_with_args(): 'lolxd-this-doesnt-exist' executable ('$GIT_EDITOR') not found
E find_executable(executable=nano): found nano at /usr/bin/nano
E __get_editor_with_args(): 'nano' executable ('git config core.editor') found
E >>> nano .git/machete
E <exit code: 1>
E
E
[path to repo]/tmp/git-machete/tests/mockers.py:58: AssertionError
----------------------------------------------------------- Captured stdout call ------------------------------------------------------------
----------------------------------------------------------- Captured stderr call ------------------------------------------------------------
Standard input is not a terminal
---------------------------- generated xml file: [path to repo]/tmp/git-machete/test-results/testenv-py.xml -----------------------------
========================================================== short test summary info ==========================================================
FAILED tests/test_edit.py::TestEdit::test_edit_editor - AssertionError: assert == failed. [pytest-clarity diff shown]
[rest redundant]
Hmmm pls make sure you're on PR #1376 (branch debug/test-edit-aur). In particular, the test has been renamed from test_edit_git_config_core_editor to test_edit_editor (I incidentally realized that the name is outdated) - and the output indicates that there's still test_edit_git_config_core_editor :/
@PawelLipski thanks a lot for your quick response. I ran the command, but the output seems almost identical:
py: commands[0]> mkdir -p test-results/
py: commands[1]> python -m pytest -p tests.pytest_full_operands --numprocesses=auto --junitxml=test-results/testenv-py.xml -m 'not completion_e2e' -k test_edit -vv
============================================================ test session starts ============================================================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 -- [path to repo]/git-machete/src/git-machete-3.31.0/.tox/py/bin/python
cachedir: .tox/py/.pytest_cache
rootdir: [path to repo]/git-machete/src/git-machete-3.31.0
configfile: tox.ini
plugins: clarity-1.0.1, mock-3.14.0, xdist-3.6.1
20 workers [6 items]
scheduling tests via LoadScheduling
tests/test_edit.py::TestEdit::test_edit_git_config_core_editor
tests/test_edit.py::TestEdit::test_edit_git_machete_editor_not_valid_executable
tests/test_edit.py::TestEdit::test_edit_git_editor
tests/test_edit.py::TestEdit::test_edit_git_machete_editor_full_path
tests/test_edit.py::TestEdit::test_edit_git_machete_editor
tests/test_edit.py::TestEdit::test_edit_no_variant_matches
[gw0] [ 16%] PASSED tests/test_edit.py::TestEdit::test_edit_git_machete_editor
[gw2] [ 33%] PASSED tests/test_edit.py::TestEdit::test_edit_git_machete_editor_not_valid_executable
[gw1] [ 50%] PASSED tests/test_edit.py::TestEdit::test_edit_git_machete_editor_full_path
[gw5] [ 66%] PASSED tests/test_edit.py::TestEdit::test_edit_no_variant_matches
[gw3] [ 83%] PASSED tests/test_edit.py::TestEdit::test_edit_git_editor
[gw4] [100%] FAILED tests/test_edit.py::TestEdit::test_edit_git_config_core_editor
================================================================= FAILURES ==================================================================
_________________________________________________ TestEdit.test_edit_git_config_core_editor _________________________________________________
[gw4] linux -- Python 3.12.7 [path to repo]/git-machete/src/git-machete-3.31.0/.tox/py/bin/python
self = <tests.test_edit.TestEdit object at 0x72559a36d550>
def test_edit_git_config_core_editor(self) -> None:
self.repo_sandbox.set_git_config_key("advice.macheteEditorSelection", "false")
with overridden_environment(GIT_MACHETE_EDITOR=" ", GIT_EDITOR="lolxd-this-doesnt-exist", VISUAL="", EDITOR=dummy_editor):
assert_success(["edit"], "")
> assert self.repo_sandbox.read_file(".git/machete").strip() == "foo"
E assert == failed. [pytest-clarity diff shown]
E
E LHS vs RHS shown below
E
E foo
E
[path to repo]/git-machete/src/git-machete-3.31.0/tests/test_edit.py:52: AssertionError
----------------------------------------------------------- Captured stdout call ------------------------------------------------------------
----------------------------------------------------------- Captured stderr call ------------------------------------------------------------
Standard input is not a terminal
------------------- generated xml file: [path to repo]/git-machete/src/git-machete-3.31.0/test-results/testenv-py.xml -------------------
========================================================== short test summary info ==========================================================
FAILED tests/test_edit.py::TestEdit::test_edit_git_config_core_editor - assert == failed. [pytest-clarity diff shown]
LHS vs RHS shown below
foo
======================================================== 1 failed, 5 passed in 1.14s ========================================================
py: exit 1 (1.31 seconds) [path to repo]/git-machete/src/git-machete-3.31.0> python -m pytest -p tests.pytest_full_operands --numprocesses=auto --junitxml=test-results/testenv-py.xml -m 'not completion_e2e' -k test_edit -vv pid=316207
py: FAIL code 1 (1.34=setup[0.03]+cmd[0.00,1.31] seconds)
evaluation failed :( (1.38 seconds)
Hmmm I struggling to reproduce your issue as it's probably something caused by the executables present on the specific machine... but actually, could you check out https://github.com/VirtusLab/git-machete/pull/1376, install tox (https://tox.wiki/en/4.23.2/installation.html) and then run:
tox -e py -- -k test_edit_editor -vv
This test will fail, but extra debug info should give us more insight into what's failing specifically. Pls check the output for any info that should be redacted (like file paths, or anything global git configs). Thanks!
I'm getting a failure in test tests/test_edit.py when installing the package. Any idea what might cause this? I tried different versions of git-machete down to 3.17.4, but go the same error each time.
_________________________________________________ TestEdit.test_edit_git_config_core_editor _________________________________________________
[gw11] linux -- Python 3.12.7 /usr/bin/python
self = <tests.test_edit.TestEdit object at 0x73b97b5ecd10>
def test_edit_git_config_core_editor(self) -> None:
self.repo_sandbox.set_git_config_key("advice.macheteEditorSelection", "false")
with overridden_environment(GIT_MACHETE_EDITOR=" ", GIT_EDITOR="lolxd-this-doesnt-exist", VISUAL="", EDITOR=dummy_editor):
assert_success(["edit"], "")
> assert self.repo_sandbox.read_file(".git/machete").strip() == "foo"
E AssertionError: assert '' == 'foo'
E
E - foo
[path to repo]/git-machete/src/git-machete-3.31.0/tests/test_edit.py:52: AssertionError
Btw... @chrislea as I probably can't commit here directly (?), could you do the following:
Add fish completion (completion/git-machete.fish), probably under "$pkgdir/usr/share/fish/vendor_completions.d" - see https://git.alpinelinux.org/aports/tree/community/git-machete/APKBUILD
Add man page (docs/man/git-machete.1)... not sure what should be the target directory, but it's probably some pretty standard one :)
Best, Paweł
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
Hey, a heads-up for an update to 3.41.0 - a new package git_machete/utils was added to packages in setup.py, pls reflect that in setup_packages.patch