These are chat archives for coala/coala-bears

19th
Apr 2017
Yash Nisar
@yash-nisar
Apr 19 2017 03:08
@jayvdb How do we take care of the # pragma no cover in check_prerequisites(..) because since we're manually installing deps for the tests ?
John Vandenberg
@jayvdb
Apr 19 2017 03:15
mock
Tulio Leao
@tupaschoal
Apr 19 2017 03:16
hello, how do I know why tests are being skipped when doing pytest? I'm assuming it is missing a dependency but would like to confirm
John Vandenberg
@jayvdb
Apr 19 2017 04:15
Yea, that is usually why bear tests skip
All the python bears shouldnt skip
Yash Nisar
@yash-nisar
Apr 19 2017 05:53
@jayvdb around for a quick discussion regarding the LuarocksRequirement ?
John Vandenberg
@jayvdb
Apr 19 2017 05:54
yup
Yash Nisar
@yash-nisar
Apr 19 2017 05:56
sarge always returns stderr as an empty string in the is_installed method
I'll send a use case to you
>>> cmd = 'luarocks list bad_package'
>>> p = run(cmd, stdout=Capture(), stderr=Capture())
>>> p.stdout.read()
b'\nInstalled rocks:\n----------------\n\n'
>>> p.stderr.read()
b''
>>> cmd = 'luarocks list luacheck'
>>> p = run(cmd, stdout=Capture(), stderr=Capture())
>>> p.stdout.read()
b'\nInstalled rocks:\n----------------\n\nluacheck\n   0.19.1-1 (installed) - /usr/local/lib/luarocks/rocks\n\n'
>>> p.stderr.read()
b''
due to which the is_installed() test fails
John Vandenberg
@jayvdb
Apr 19 2017 05:59
well, I get
p.stderr.read()
b'Warning: Failed loading manifest for /usr/lib64/luarocks/rocks: /usr/lib64/luarocks/rocks/manifest: No such file or directory\n'
Yash Nisar
@yash-nisar
Apr 19 2017 06:00
what is the luarocks version that you're using ?
John Vandenberg
@jayvdb
Apr 19 2017 06:01
2.3.0
Yash Nisar
@yash-nisar
Apr 19 2017 06:02
I'm using 2.2.0, which was installed via the apt-get manager
Thanks ! :smile:
John Vandenberg
@jayvdb
Apr 19 2017 06:02
I doubt that matters. I assume that stderr contains nothing if that problem is fixed
Yash Nisar
@yash-nisar
Apr 19 2017 06:03
This is the output that I get :
 yash  (e) venv  ~ | Code | Repositories | package_manager  luarocks list bad_package

Installed rocks:
----------------
 yash  (e) venv  ~ | Code | Repositories | package_manager  luarocks list luacheck

Installed rocks:
----------------

luacheck
   0.19.1-1 (installed) - /usr/local/lib/luarocks/rocks
John Vandenberg
@jayvdb
Apr 19 2017 06:08
right. so to check it is installed, you need to see if the package name is in the stdout
that is similar to some of the package managers in DistributionRequirement
Yash Nisar
@yash-nisar
Apr 19 2017 06:13

So, I presume

        if not run(cmd, stdout=Capture(), stderr=Capture()).returncode:
            return True

will always return true since stderr is an empty string ?

John Vandenberg
@jayvdb
Apr 19 2017 06:16
returncode has nothing to do with stderr
the program chooses the returncode
a program can emit messages on stderr , and still return with exit code 0 if wants
in fact, coala used to do this until very recently when @NiklasMM fix it
Yash Nisar
@yash-nisar
Apr 19 2017 06:17
Okay
John Vandenberg
@jayvdb
Apr 19 2017 06:17
it is 'bad' to emit messages on stderr , and still return with exit code 0, but ... perfectly possible
Yash Nisar
@yash-nisar
Apr 19 2017 06:18
I'll get back to you in sometime once I'm done with the MR :)
John Vandenberg
@jayvdb
Apr 19 2017 06:18
so if you want to use returncode, you need to check that luarocks uses a non-zero exit code if the package isnt installed
Yash Nisar
@yash-nisar
Apr 19 2017 06:19
yeah, investigating on those things
Yash Nisar
@yash-nisar
Apr 19 2017 09:51
@jayvdb quick merge https://gitlab.com/coala/package_manager/merge_requests/50 ? The .idea folder is annoying :stuck_out_tongue:
Abinash Senapati
@Techievena
Apr 19 2017 09:53
@yash-nisar Can you also add this https://gitlab.com/coala/package_manager/issues/48 to it.
Yash Nisar
@yash-nisar
Apr 19 2017 09:54
Sure :wink:
Naveen Tata
@naveentata
Apr 19 2017 13:30
@jayvdb Could you look at this coala/coala-bears#1496
Satwik Kansal
@satwikkansal
Apr 19 2017 15:41
@jayvdb :point_up_2: https://gitter.im/coala/coala-bears?at=58ef6ad4f22385553d3937a4 , treyhunner hasn't seen my messages yet, looks like he's not active on gitter, should we try some other means?
John Vandenberg
@jayvdb
Apr 19 2017 17:26
@satwikkansal , ok, lets do some design in a gdoc (or similar), with the goal of proposing it on their mailing list
Satwik Kansal
@satwikkansal
Apr 19 2017 18:57
@jayvdb sure, I'll make a gdoc including basic design and share with you in some time