Package thefuck is broken

  • Done
  • quality assurance status badge
Details
4 participants
  • Andrew Stubbs
  • Andrew Stubbs
  • John Kehayias
  • Leo Famulari
Owner
unassigned
Submitted by
Andrew Stubbs
Severity
normal
A
A
Andrew Stubbs wrote on 9 Jan 11:43 +0100
(address . bug-guix@gnu.org)
CAC1cuBRcmqJ6CVWxqPbM06zUy5z1Gr0B=82gWMCTW5zFUttxmA@mail.gmail.com
"guix shell thefuck" fails:

building /gnu/store/qkhrgs2wvxwzhv71kzp6fhxnf3gk8nsh-thefuck-3.32.drv...
\ 'check' phasebuilder for
`/gnu/store/qkhrgs2wvxwzhv71kzp6fhxnf3gk8nsh-thefuck-3.32.drv' failed with
exit code 1
build of /gnu/store/qkhrgs2wvxwzhv71kzp6fhxnf3gk8nsh-thefuck-3.32.drv failed
View build log at
'/var/log/guix/drvs/qk/hrgs2wvxwzhv71kzp6fhxnf3gk8nsh-thefuck-3.32.drv.gz'.
guix shell: error: build of
`/gnu/store/qkhrgs2wvxwzhv71kzp6fhxnf3gk8nsh-thefuck-3.32.drv' failed

This is straight after a "guix pull". I tested on Ubuntu 20.04, Ubuntu
22.04, and Ubuntu 24.11.

From the logfile:


=========================== short test summary info
============================
FAILED
tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[le
cat-result0]
FAILED
tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[diff
x-result1]
FAILED
tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[fuck-result2]
FAILED
tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[cafe
\xf4-result3]

=================================== FAILURES
===================================
_
TestGetValidHistoryWithoutCurrent.test_get_valid_history_without_current[le
cat-result0] _


self = <tests.test_utils.TestGetValidHistoryWithoutCurrent object at
0x7ffff50aa290>
script = 'le cat', result = ['ls cat', 'diff x', 'café ô']



@pytest.mark.parametrize('script, result', [

('le cat', ['ls cat', 'diff x', u'café ô']),

('diff x', ['ls cat', u'café ô']),

('fuck', ['ls cat', 'diff x', u'café ô']),

(u'cafe ô', ['ls cat', 'diff x', u'café ô']),

])

def test_get_valid_history_without_current(self, script, result):

command = Command(script, '')

Toggle quote (2 lines)
> assert get_valid_history_without_current(command) == result

E AssertionError: assert ['ls cat', 'diff x'] == ['ls cat', 'diff x',
'café ô']
E

E Right contains one more item: 'café ô'

E

E Full diff:

E [

E 'ls cat',

E 'diff x',

E - 'café ô',

E ]



/tmp/guix-build-thefuck-3.32.drv-0/source/tests/test_utils.py:276:
AssertionError
Attachment: file
J
J
John Kehayias wrote on 10 Jan 22:43 +0100
(name . Andrew Stubbs)(address . andrew.stubbs@gmail.com)(address . 75464@debbugs.gnu.org)
877c72gxaa.fsf@protonmail.com
Hi Andrew

On Thu, Jan 09, 2025 at 10:43 AM, Andrew Stubbs wrote:

[...]
Toggle quote (7 lines)
> =========================== short test summary info ============================
> FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[le cat-result0]
> FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[diff x-result1]
> FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[fuck-result2]
> FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[cafe \xf4-result3]
>
> =================================== FAILURES ===================================
[...]

I noticed this as well recently, thanks for reporting. I think this is
Unfortunately there's been no activity there or on the project in
general (for a year). I guess we could disable just those tests and link
to the upstream issue, would you like to take a stab at a patch?

John
A
A
Andrew Stubbs wrote 7 days ago
[bug#75464][PATCH] Remove broken tests from "thefuck"
(address . guix-patches@gnu.org)
4b4ecfa14654fa61184f2c34df95d9e49a49d06a.1737731231.git.ams@baylibre.com
These tests are reported broken upstream, but nothing has been done about it.

* gnu/packages/admin.scm (thefuck): Add patch.
* gnu/packages/patches/thefuck-remove-broken-tests.patch: New file.

Change-Id: Ib6bbda92b29cd2a26b9c08d79e309e2c78602b71
---
gnu/packages/admin.scm | 3 +-
.../patches/thefuck-remove-broken-tests.patch | 48 +++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/thefuck-remove-broken-tests.patch

Toggle diff (72 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 89879bf486..6290ecc72d 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -3749,7 +3749,8 @@ (define-public thefuck
(file-name (git-file-name name version))
(sha256
(base32 "18ipa1bm6q1n5drbi8i65726hhqhl1g41390lfqrc11hkbvv443d"))
- (patches (search-patches "thefuck-test-environ.patch"))))
+ (patches (search-patches "thefuck-test-environ.patch"
+ "thefuck-remove-broken-tests.patch"))))
(build-system python-build-system)
(arguments
'(#:phases
diff --git a/gnu/packages/patches/thefuck-remove-broken-tests.patch b/gnu/packages/patches/thefuck-remove-broken-tests.patch
new file mode 100644
index 0000000000..1d494c060c
--- /dev/null
+++ b/gnu/packages/patches/thefuck-remove-broken-tests.patch
@@ -0,0 +1,48 @@
+diff -ruN a/tests/test_utils.py b/tests/test_utils.py
+--- a/tests/test_utils.py 1970-01-01 00:00:01.000000000 +0000
++++ b/tests/test_utils.py 2025-01-22 12:21:07.045281481 +0000
+@@ -233,44 +233,3 @@
+ assert fn() == 'test'
+ assert shelve == {key: {'etag': '0', 'value': 'test'}}
+
+-
+-class TestGetValidHistoryWithoutCurrent(object):
+- @pytest.fixture(autouse=True)
+- def fail_on_warning(self):
+- warnings.simplefilter('error')
+- yield
+- warnings.resetwarnings()
+-
+- @pytest.fixture(autouse=True)
+- def history(self, mocker):
+- mock = mocker.patch('thefuck.shells.shell.get_history')
+- # Passing as an argument causes `UnicodeDecodeError`
+- # with newer py.test and python 2.7
+- mock.return_value = ['le cat', 'fuck', 'ls cat',
+- 'diff x', 'nocommand x', u'café ô']
+- return mock
+-
+- @pytest.fixture(autouse=True)
+- def alias(self, mocker):
+- return mocker.patch('thefuck.utils.get_alias',
+- return_value='fuck')
+-
+- @pytest.fixture(autouse=True)
+- def bins(self, mocker):
+- callables = list()
+- for name in ['diff', 'ls', 'café']:
+- bin_mock = mocker.Mock(name=name)
+- bin_mock.configure_mock(name=name, is_dir=lambda: False)
+- callables.append(bin_mock)
+- path_mock = mocker.Mock(iterdir=mocker.Mock(return_value=callables))
+- return mocker.patch('thefuck.utils.Path', return_value=path_mock)
+-
+- @pytest.mark.parametrize('script, result', [
+- ('le cat', ['ls cat', 'diff x', u'café ô']),
+- ('diff x', ['ls cat', u'café ô']),
+- ('fuck', ['ls cat', 'diff x', u'café ô']),
+- (u'cafe ô', ['ls cat', 'diff x', u'café ô']),
+- ])
+- def test_get_valid_history_without_current(self, script, result):
+- command = Command(script, '')
+- assert get_valid_history_without_current(command) == result

base-commit: e3066fe7dab3d4fcd22884ce55555ac1f16e583f
--
2.47.1
A
A
Andrew Stubbs wrote 3 days ago
Package thefuck is broken
(address . 75464@debbugs.gnu.org)
e4544d25-28f4-4b0f-b585-146d4fae9544@baylibre.com
I sent a patch to guix-patches. It has shown up in the bug tracker, but
it's not in the mailing list archives ... maybe it got filtered (language?).

Will the maintainers have received it, or no?
L
L
Leo Famulari wrote 3 days ago
(name . Andrew Stubbs)(address . ams@baylibre.com)(address . 75464@debbugs.gnu.org)
Z5k6oJ3O8gp9spW8@jasmine.lan
On Tue, Jan 28, 2025 at 05:23:23PM +0000, Andrew Stubbs wrote:
Toggle quote (3 lines)
> I sent a patch to guix-patches. It has shown up in the bug tracker, but it's
> not in the mailing list archives ... maybe it got filtered (language?).

Weird.

Toggle quote (2 lines)
> Will the maintainers have received it, or no?

I did receive an email with this subject:

Subject: bug#75464: [PATCH] Remove broken tests from "thefuck"

Is that the one?
A
A
Andrew Stubbs wrote 2 days ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 75464@debbugs.gnu.org)
CAEg+1qYEXAbOyzFYLM8fF=xo-4J7mNwiz9vWOx01OUMxgmXV1g@mail.gmail.com
Yes, that's the one. It's probably not lost then. :-)

Thank you.

On Tue, 28 Jan 2025, 20:14 Leo Famulari, <leo@famulari.name> wrote:

Toggle quote (15 lines)
> On Tue, Jan 28, 2025 at 05:23:23PM +0000, Andrew Stubbs wrote:
> > I sent a patch to guix-patches. It has shown up in the bug tracker, but
> it's
> > not in the mailing list archives ... maybe it got filtered (language?).
>
> Weird.
>
> > Will the maintainers have received it, or no?
>
> I did receive an email with this subject:
>
> Subject: bug#75464: [PATCH] Remove broken tests from "thefuck"
>
> Is that the one?
>
Attachment: file
L
L
Leo Famulari wrote 27 hours ago
Re: bug#75464: [PATCH] Remove broken tests from "thefuck"
(name . Andrew Stubbs)(address . ams@baylibre.com)
Z5sSankS3Wu9J4wz@jasmine.lan
On Fri, Jan 24, 2025 at 03:34:12PM +0000, Andrew Stubbs wrote:
Toggle quote (2 lines)
> These tests are reported broken upstream, but nothing has been done about it.

Thanks for filing this bug report and making a patch to fix it!

I pushed your patch as commit a20df73c7d69356c0800dcc082c1a71e987acf13
with the following changes:

Most importantly, I registered the patch in 'gnu/local.mk'. Without
this, the patch file will not be included in the distribution when Guix
is built.

I made the commit message conform to the GNU ChangeLog format (at least
how we use it in Guix), and I made the commit message a little more
informative, including a link to this bug report.

I also added a comment to the patch file itself to give useful context.
This helps a lot in the future when trying to understand the context of
the patch files.
Closed
A
A
Andrew Stubbs wrote 17 hours ago
Package thefuck is broken
(address . 75464@debbugs.gnu.org)
01c2c780-7638-4094-a276-7c3a130cda26@baylibre.com
Thank you, Leo.

I can confirm that thefuck installs again, after "guix pull".
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75464@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75464
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch