Closed eddsalkield closed 1 year ago
Are you on a 32-bit or 64-bit platform? And have you checked out a particular branch or commit or just the 2.10.1 release tag? What is the exact command you used to run the testsuite? There are some known issues with the --size code but I don't think I've seen that failure before.
tests/test_options/test_size.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_options/test_size.py b/tests/test_options/test_size.py
index 51de398d..7940ca25 100644
--- a/tests/test_options/test_size.py
+++ b/tests/test_options/test_size.py
@@ -101,7 +101,7 @@ def test_replay_size():
head, *data, footer = run_rmlint('--replay {p} --size 1-10B'.format(
p=replay_path
- ))
+ ), verbosity='-vv')
assert [e["type"] for e in data] == \
["emptydir"] + (["emptyfile"] * 2) + (["duplicate_file"] * 4)
If you put the above in a file called verbosity.patch
and then run the following commands in the rmlint-2.10.1
directory, what output do you get? You should see [okay]
on several lines and not [nope: bad size]
.
$ patch -Np1 <verbosity.patch
$ RM_TS_PRINT_CMD=1 nosetests -d tests/test_options/test_size.py:test_replay_size
This is the output I get with latest master on 64-bit Arch Linux:
INFO: Loading json-results `/tmp/rmlint-unit-testdir/replay.json'
Checking `/tmp/rmlint-unit-testdir/empty_dir`: [okay]
Checking `/tmp/rmlint-unit-testdir/empty2`: [okay]
Checking `/tmp/rmlint-unit-testdir/empty1`: [okay]
Checking `/tmp/rmlint-unit-testdir/b/yyy`: [okay]
Checking `/tmp/rmlint-unit-testdir/a/yyy`: [okay]
Checking `/tmp/rmlint-unit-testdir/b/xxx`: [okay]
Checking `/tmp/rmlint-unit-testdir/a/xxx`: [okay]
.
----------------------------------------------------------------------
Ran 1 test in 0.112s
OK
Sorry for the lack of specificity in the initial report.
Are you on a 32-bit or 64-bit platform?
I'm on x86_64.
And have you checked out a particular branch or commit or just the 2.10.1 release tag?
This is the 2.10.1 release.
What is the exact command you used to run the testsuite?
scons test
I've run with the verbose patch, and the error became immediately apparent - a lack of json-glib libraries:
test_size.test_replay_size ... ERROR: json-glib is needed for using --replay.
ERROR: Please recompile `rmlint` with it installed.
WARNING: Loading /tmp/replay.json failed.
ERROR: No valid .json files given, aborting.
ERROR
However, I have these libraries currently installed. I think it's something to do with SConstruct
checking for json-glib-1.0
instead of json-glib
:
henleybeach:~$ pkg-config --exists json-glib-1.0
henleybeach:~$ echo $?
0
henleybeach:~$ pkg-config --exists json-glib
henleybeach:~$ echo $?
1
I tried modifying the SConstruct file with s/json-glib-1.0/json-glib/g
but still getting:
henleybeach:~$ scons config
...
Find non-stripped binaries (needs libelf) : no
Optimize using ioctl(FS_IOC_FIEMAP) (needs linux) : yes
Support for SHA512 (needs glib >= 2.31) : yes
Build manpage from docs/rmlint.1.rst : yes, using /usr/bin/sphinx-build
Support for caching checksums in file's xattr : yes
Support for reading json caches (needs json-glib) : no
Any further thoughts?
Based on the command output it looks like json-glib-1.0 does in fact exist (zero indicates success). The result of pkg-config is cached so you may need to clear the SCons cache if you have installed json-glib-dev since your first run:
$ rm -rf .sconf_temp .sconsign.dblite
$ scons -c
$ scons config
If that doesn't change anything then the output of these commands would be useful:
$ pkg-config --path json-glib-1.0
$ env | grep PKG_CONFIG
Based on the command output it looks like json-glib-1.0 does in fact exist (zero indicates success).
It's bizarre since that zero for success is the usual convention, but I think it's actually the other way around in this case (or maybe I'm misreading): https://github.com/sahib/rmlint/blob/2711b84bb264b41015d718b06b0e5be065d42ebc/SConstruct#L81
The result of pkg-config is cached so you may need to clear the SCons cache if you have installed json-glib-dev since your first run
I ran it on a completely clean source directory and got the same result as I initially reported.
Command outputs:
henleybeach:~$ pkg-config --path json-glib-1.0
/usr/lib/pkgconfig/json-glib-1.0.pc
henleybeach:~$ env | grep PKG_CONFIG
henleybeach:~$ pkg-config --path json-glib
Thanks for helping me track this one down!
I finally got around to installing Alpine Linux 3.16 (alpine-standard-3.16.2-x86_64.iso) and testing this for myself. Here's what I did:
doas apk update
doas apk add git gcc scons libc-dev glib-dev json-glib-dev py3-nose py3-pip
pip install xattr
git clone https://github.com/sahib/rmlint.git
cd rmlint
scons config
- shows this in the output:
Support for reading json caches (needs json-glib) : yes
scons GDB=1
nosetests tests/test_options/test_size.py:test_replay_size
- shows this output:
.
----------------------------------------------------------------------
Ran 1 test in 0.113s
OK
So I cannot reproduce the issue. Let me know if there's anything special about your system configuration that's different from what I did here.
Currently on Alpine Linux 3.16, the test
test_size.test_replay_size
fails silently with exit code 1.