Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 935400 - app-shells/bash-completion-2.14.0 and 2.14.0-r1 : test fail : 2 tests: test_sudo.py test_xfreerdp.py
Summary: app-shells/bash-completion-2.14.0 and 2.14.0-r1 : test fail : 2 tests: test_s...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2024-07-03 10:49 UTC by Arniii
Modified: 2024-07-08 07:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/app-shells/bash-completion-2.14.0/temp/build.log (bashcompletion_build_log.zip,90.67 KB, application/zip)
2024-07-03 10:49 UTC, Arniii
Details
config.log (file_935400.txt,8.78 KB, text/plain)
2024-07-03 10:51 UTC, Arniii
Details
environment // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13.2.1_p20240210 O3 pipe march=native(verbose) lto graphite ggdb3 (file_935400.txt,99.50 KB, text/plain)
2024-07-03 10:52 UTC, Arniii
Details
/etc/portage/make.conf // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3 testing FEATUREs : testing (file_935400.txt,4.32 KB, text/plain)
2024-07-03 10:52 UTC, Arniii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arniii 2024-07-03 10:49:43 UTC
Created attachment 896844 [details]
/var/tmp/portage/app-shells/bash-completion-2.14.0/temp/build.log

There's different fail than in https://bugs.gentoo.org/931744 .

from build.log:
```
ERROR test/t/test_xfreerdp.py::TestXfreerdp::test_6 - AssertionError: Unexpected output: [[10:39:16:870] [9777:00002631] [ERROR][com.winpr.commandline] - [log_error]: Failed at index 1 [--kbd-list]: Unexpected keyword
]
FAILED test/t/test_sudo.py::TestSudo::test_1 - assert <CompletionResult []>
============================== 1 failed, 1742 passed, 257 skipped, 13 xfailed, 4 xpassed, 40978 warnings, 1 error in 54.65s ==============================

```

Also from build.log:
```
========================================================================= ERRORS =========================================================================
_________________________________________________________ ERROR at setup of TestXfreerdp.test_6 __________________________________________________________
[gw21] linux -- Python 3.12.3 /usr/bin/python3.12

request = <SubRequest 'completion' for <Function test_6>>, bash = <pexpect.pty_spawn.spawn object at 0x7f899a1b76e0>

    @pytest.fixture
    def completion(request, bash: pexpect.spawn) -> CompletionResult:
        marker = request.node.get_closest_marker("complete")
        if not marker:
            return CompletionResult()
        for pre_cmd in marker.kwargs.get("pre_cmds", []):
            assert_bash_exec(bash, pre_cmd, want_output=None)
        cmd = getattr(request.cls, "cmd", None)
        if marker.kwargs.get("require_longopt"):
            # longopt completions require both command presence and that it
            # responds something useful to --help
            if "require_cmd" not in marker.kwargs:
                marker.kwargs["require_cmd"] = True
            if "xfail" not in marker.kwargs:
                marker.kwargs["xfail"] = (
                    # --help is required to exit with zero in order to not get a
                    # positive for cases where it errors out with a message like
                    # "foo: unrecognized option '--help'"
                    "! %s --help &>/dev/null || "
                    "! %s --help 2>&1 | command grep -qF -- --help"
                ) % ((cmd,) * 2)
        if marker.kwargs.get("require_cmd") and not is_bash_type(bash, cmd):
            pytest.skip("Command not found")

>       return assert_complete(bash, marker.args[0], **marker.kwargs)

bash       = <pexpect.pty_spawn.spawn object at 0x7f899a1b76e0>
cmd        = 'xfreerdp'
marker     = Mark(name='complete', args=('xfreerdp -k ',), kwargs={'require_cmd': True})
request    = <SubRequest 'completion' for <Function test_6>>

/var/tmp/portage/app-shells/bash-completion-2.14.0/work/bash-completion-2.14.0/test/t/conftest.py:915:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

bash = <pexpect.pty_spawn.spawn object at 0x7f899a1b76e0>, cmd = 'xfreerdp -k ', kwargs = {'require_cmd': True}, skipif = None, xfail = None
bash_env = <conftest.bash_env_saved object at 0x7f899a249af0>, cwd = None, input_cmd = 'xfreerdp -k '

    def assert_complete(
        bash: pexpect.spawn, cmd: str, **kwargs
    ) -> CompletionResult:
        skipif = kwargs.get("skipif")
        if skipif:
            try:
                assert_bash_exec(bash, skipif, want_output=None)
            except AssertionError:
                pass
            else:
                pytest.skip(skipif)
        xfail = kwargs.get("xfail")
        if xfail:
            try:
                assert_bash_exec(bash, xfail, want_output=None)
            except AssertionError:
                pass
            else:
                pytest.xfail(xfail)

        with bash_env_saved(bash, sendintr=True) as bash_env:
            cwd = kwargs.get("cwd")
            if cwd:
                bash_env.chdir(str(cwd))

            for k, v in kwargs.get("env", {}).items():
                bash_env.write_env(k, v, quote=False)

            for k, v in kwargs.get("shopt", {}).items():
                bash_env.shopt(k, v)

            input_cmd = cmd
            rendered_cmd = kwargs.get("rendered_cmd", cmd)
            re_MAGIC_MARK = re.escape(MAGIC_MARK)

            trail = kwargs.get("trail")
            if trail:
                # \002 = ^B = cursor left
                input_cmd += trail + "\002" * len(trail)
                rendered_cmd += trail + "\b" * len(trail)

                # After reading the results, something weird happens. For most test
                # setups, as expected (pun intended!), MAGIC_MARK follows as
                # is. But for some others (e.g. CentOS 6, Ubuntu 14 test
                # containers), we get MAGIC_MARK one character a time, followed
                # each time by trail and the corresponding number of \b's. Don't
                # know why, but accept it until/if someone finds out.  Or just be
                # fine with it indefinitely, the visible and practical end result
                # on a terminal is the same anyway.
                maybe_trail = "(%s%s)?" % (re.escape(trail), "\b" * len(trail))
                re_MAGIC_MARK = "".join(
                    re.escape(x) + maybe_trail for x in MAGIC_MARK
                )

            bash.send(input_cmd + "\t")
            # Sleep a bit if requested, to avoid `.*` matching too early
            time.sleep(kwargs.get("sleep_after_tab", 0))
            bash.expect_exact(rendered_cmd)
            bash.send(MAGIC_MARK)
            got = bash.expect(
                [
                    # 0: multiple lines, result in .before
                    r"\r\n" + re.escape(PS1 + rendered_cmd) + ".*" + re_MAGIC_MARK,
                    # 1: no completion
                    r"^" + re_MAGIC_MARK,
                    # 2: on same line, result in .match
                    r"^([^\r]+)%s$" % re_MAGIC_MARK,
                    # 3: error messages
                    r"^([^\r].*)%s$" % re_MAGIC_MARK,
                    pexpect.EOF,
                    pexpect.TIMEOUT,
                ]
            )
            if got == 0:
                output = re.sub(re_MAGIC_MARK + "$", "", bash.before)
                return CompletionResult(output)
            elif got == 2:
                output = bash.match.group(1)
                return CompletionResult(output)
            elif got == 3:
                output = bash.match.group(1)
>               raise AssertionError("Unexpected output: [%s]" % output)
E               AssertionError: Unexpected output: [[10:39:16:870] [9777:00002631] [ERROR][com.winpr.commandline] - [log_error]: Failed at index 1 [--kbd-list]: Unexpected keyword
E               ]

bash       = <pexpect.pty_spawn.spawn object at 0x7f899a1b76e0>
bash_env   = <conftest.bash_env_saved object at 0x7f899a249af0>
cmd        = 'xfreerdp -k '
cwd        = None
got        = 3
input_cmd  = 'xfreerdp -k '
kwargs     = {'require_cmd': True}
output     = ('[10:39:16:870] [9777:00002631] [ERROR][com.winpr.commandline] - [log_error]: '
 'Failed at index 1 [--kbd-list]: Unexpected keyword\r\n')
re_MAGIC_MARK = '__MaGiC\\-maRKz\\-NEtXZVZfKC__'
rendered_cmd = 'xfreerdp -k '
skipif     = None
trail      = None
xfail      = None

/var/tmp/portage/app-shells/bash-completion-2.14.0/work/bash-completion-2.14.0/test/t/conftest.py:885: AssertionError
======================================================================== FAILURES ========================================================================
____________________________________________________________________ TestSudo.test_1 _____________________________________________________________________
[gw15] linux -- Python 3.12.3 /usr/bin/python3.12

self = <test_sudo.TestSudo object at 0x7f9d0a3137d0>, completion = <CompletionResult []>

    @pytest.mark.complete("sudo -", require_cmd=True)
    def test_1(self, completion):
>       assert completion
E       assert <CompletionResult []>

completion = <CompletionResult []>
self       = <test_sudo.TestSudo object at 0x7f9d0a3137d0>

/var/tmp/portage/app-shells/bash-completion-2.14.0/work/bash-completion-2.14.0/test/t/test_sudo.py:9: AssertionError
```
Comment 1 Arniii 2024-07-03 10:51:43 UTC
Created attachment 896845 [details]
config.log
Comment 2 Arniii 2024-07-03 10:52:19 UTC
Created attachment 896846 [details]
environment // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13.2.1_p20240210 O3 pipe march=native(verbose) lto graphite ggdb3
Comment 3 Arniii 2024-07-03 10:52:40 UTC
Created attachment 896847 [details]
/etc/portage/make.conf // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3 testing FEATUREs : testing
Comment 4 Arniii 2024-07-08 07:15:54 UTC
Reproducible with app-shells/bash-completion-2.14.0-r1