These are chat archives for coala/coala-bears

9th
Aug 2018
Ishan Srivastava
@ishanSrt
Aug 09 2018 07:33
@jayvdb how can i sort of clone a repo for a unittest to test my final output against? Individual tests are too time consuming and too lengthy and require a lot of debugging and certain scenarios for branch coverage are just too difficult to achieve like mocking output of os.walk 30 times with each value different depending on the file structure i gave as an input to the function
i mean os.walk gets called 30 times by the function expecting different output each time
John Vandenberg
@jayvdb
Aug 09 2018 07:40
have an 'integration' test module, which does a setUp of cloning repo, check out a specific sha, and then tests run on it, and you delete the repo after
the biggest problem is that you may have timeout issues for large repos, so you may need to configure pytest differently to show logging, or something
for that, hack at setup.cfg directly, disable moban checking, and then when build passes we figure out the template changes you need
John Vandenberg
@jayvdb
Aug 09 2018 07:46
we need a pytest 'heartbeat' plugin to fake activity for long running test methods
but try to keep the test method as short as possible
John Vandenberg
@jayvdb
Aug 09 2018 09:49
@ishanSrt forgot to mention, checkout the VCS bears tests ; they do real clones, and they also have some funky setUp and tearDown logic, especially for windows problems
another option to try is pytest-git
ive never tried it, but that repo is where we get pytest-profiling, and seems to be maintained ok
John Vandenberg
@jayvdb
Aug 09 2018 10:23
but I see they dont have windows testing manahl/pytest-plugins#19
Ishan Srivastava
@ishanSrt
Aug 09 2018 14:32
@jayvdb .nocover.yaml doesn’t seem to be working here for the regex def green_mode coala/coala-quickstart#263
John Vandenberg
@jayvdb
Aug 09 2018 14:34
looking
ive found all args need to be on the same line to use that syntax
i.e. must end with ):
split the file into two and ignore the entire file ?
Ishan Srivastava
@ishanSrt
Aug 09 2018 14:40
Yes or adding the last line of the function definition works too
John Vandenberg
@jayvdb
Aug 09 2018 14:41
but that isnt as pretty
Ishan Srivastava
@ishanSrt
Aug 09 2018 14:42
also i seem to have added tests for the function ask_to_select_languages in Project.py in the earlier commit, the test is still there and it was fully covered but just realized that it has 0% coverage on the function now
Ishan Srivastava
@ishanSrt
Aug 09 2018 15:32
i had to add that too to .nocover.yamltoo
happened definitely after the rebase
Kriti Rohilla
@kriti21
Aug 09 2018 17:29
Can anyone help me with https://github.com/coala/coala-bears/pull/2523#discussion_r208572674 ? I am not able to access files settings from .coafile inside this bear.
Ishan Srivastava
@ishanSrt
Aug 09 2018 17:38
@jayvdb what can be done about the timeout on appveyor https://ci.appveyor.com/project/coala/coala-quickstart/build/1.0.574/job/na9pice0u8245iql
not going away with repeated builds
Vaibhav Rai
@RaiVaibhav
Aug 09 2018 19:57
@kriti21 any specific error?
Kriti Rohilla
@kriti21
Aug 09 2018 19:58
Section has no field named files
Vaibhav Rai
@RaiVaibhav
Aug 09 2018 19:58
le me check
self.section['files']
Vaibhav Rai
@RaiVaibhav
Aug 09 2018 20:09
you need to take a look at a section, simple approach to inspect the section is to put the import pdb;pdb.set_trace in inside some function of processing.py file (like instantiate_bears) and after that inspect the section
because every bear knows where it came from :P
Kriti Rohilla
@kriti21
Aug 09 2018 20:10
ok let me try that
Vaibhav Rai
@RaiVaibhav
Aug 09 2018 20:13
can you correct John there :P there is nothing like section.files https://github.com/coala/coala/blob/master/coalib/settings/Section.py#L124
Kriti Rohilla
@kriti21
Aug 09 2018 20:13
Exactly :P
What are instantiate_bears ?
Kriti Rohilla
@kriti21
Aug 09 2018 20:16
Oh okay Thanks a lot
Vaibhav Rai
@RaiVaibhav
Aug 09 2018 20:16
put pdb inside that function
and inspect the section