These are chat archives for coala/coala-bears

8th
Apr 2018
Dopamine Gamer
@DopamineGamer_twitter
Apr 08 2018 02:44
Hello guys, I have an ascii decode problem with pyprint/ConsolePrinter.py. Was wondering if I should file an issue.
Ishan Srivastava
@ishanSrt
Apr 08 2018 04:16
while testing the method gather_configuration() of ConfigurationGathering.py, when i pass a set of args with bear names, i get the proper return value by the function (eg. the dictionary of local and global bears) with pytest while on the CI these dictionaries are all empty. What can be the reason for this?
Eg
sections, local_bears, global_bears, targets = (
            gather_configuration(
                *args,
                arg_list=['-b PyromaBear']))
Pytest gives me:
{'python': [], 'flakes': [], 'autopep8': [], 'linelength': [], 'docs': [], 'languagetool': [], 'commit': [<class 'GitCommitBear.GitCommitBear'>], 'pylint': [], 'linecounti
ng': [], 'invalidlinks': [], 'css': [], 'rst': [], 'text': [], 'todos': [], 'urllib': [], 'yml': [], 'cli': [<class 'PyromaBear.PyromaBear'>]}
while all the CIs are giving me:
{'autopep8': [], 'commit': [], 'python': [], 'urllib': [], 'text': [], 'rst': [], 'linecounting': [], 'pylint': [], 'docs': [], 'linelength': [], 'languagetool': [], 'flakes': [], 'invalidlinks': [], 'todos': [], 'cli': [], 'css': []}
John Vandenberg
@jayvdb
Apr 08 2018 08:21
the linters are missing ?
@DopamineGamer_twitter, sure, want to show us a backtrace and we can help determine what is going on, and whether an issue is appropriate
are you using pyprint directly, or via coala ?
Ishan Srivastava
@ishanSrt
Apr 08 2018 08:55
@jayvdb are real bears supposed to behave that way?
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:01
and if I use a dummy bear, since I am not just checking results, the function actually tries to match the given bear with the list of installed bears, so is there any way i can make my dummy bear, installable for the unittest?
John Vandenberg
@jayvdb
Apr 08 2018 09:14
you are talking about coala CI. the bears and linters are not installed
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:16
so how is this supposed to work?
even if i make a dummy bear
John Vandenberg
@jayvdb
Apr 08 2018 09:18
see other test cases which use dummy bears
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:19
actually i see many using real bears
John Vandenberg
@jayvdb
Apr 08 2018 09:21
only in layers of the parsing which dont load the bears
and we should remove them there also, as it creates this type of confusion.
better to use dummy bear names everywhere
the coala/coala CI is quick because none of the bears and their dependencies are installed
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:24

yeah i got that from earlier from someone else

only in layers of the parsing which dont load the bears

something to do with this decorator?

@pytest.mark.usefixtures('disable_bears’)
John Vandenberg
@jayvdb
Apr 08 2018 09:25
possibly
better to ask in coala room, and coala core ppl. I tend to spend more time in the bears area
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:37
@jayvdb the other tests using dummy bears just pass the argument, -b DummyBear as such , apparently the function gives out those bears as it is in one of the return values which they test against. what i need for my test is for a global bear to be present. that brings me back to, can i somehow specify for the sake of my unittest for a bear to be a global bear. Of course I can create one but there’s no way the CI is going to know about it, as the function doesn’t take in any arguments specifying the bears
John Vandenberg
@jayvdb
Apr 08 2018 09:53
@ishanSrt , we should have test bears which are global bears
if not, create one
the 'dummy' bears are real bears in the test directory; they do nothing, or do specific things which are used in tests
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:55
so how will the CI know about these bears?
John Vandenberg
@jayvdb
Apr 08 2018 09:55
they are in the coala tests directory
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:55
the CI always gives me
{'autopep8': [], 'commit': [], 'python': [], 'urllib': [], 'text': [], 'rst': [], 'linecounting': [], 'pylint': [], 'docs': [], 'linelength': [], 'languagetool': [], 'flakes': [], 'invalidlinks': [], 'todos': [], 'cli': [], 'css': []}
John Vandenberg
@jayvdb
Apr 08 2018 09:56
you need to set up the test scenario you need
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:56
ok so you mean actual bear files not just any class deriving from GlobalBear
so will have to install them too on the CI?
John Vandenberg
@jayvdb
Apr 08 2018 09:57

they are in the coala tests directory

go look

$ git grep GlobalBear tests
Ishan Srivastava
@ishanSrt
Apr 08 2018 09:59
please clear this too: so CI doesn’t have any bears installed, yet it points out the inconsistencies in PEP8 or such
John Vandenberg
@jayvdb
Apr 08 2018 10:00
we install the bears after the test suite
but only the python bears, and csslint
Damian Stachura
@damian1996
Apr 08 2018 11:08
@HizkiFW I corrected coala/coala-bears#2227 :)
Hizkia Felix
@HizkiFW
Apr 08 2018 13:02
Great :+1: