<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10789</bug_id>
          
          <creation_ts>2016-12-12 14:50:55 +0000</creation_ts>
          <short_desc>patchtest-oe: Include a test case that fails in case pylint issues are found on new patch changes</short_desc>
          <delta_ts>2017-12-06 17:20:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Patchwork/Patchtest</product>
          <component>Patchtest Testsuite</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</reporter>
          <assigned_to name="Daniela Plascencia">daniela.plascencia</assigned_to>
          <cc>bluelightning</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69040</commentid>
    <comment_count>0</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-12-12 14:50:55 +0000</bug_when>
    <thetext>Currently there is a pylint check at the repository but the output is not the desired one. Current logic may be broken. Also we need to investigate if pylint can warn just a set of checks that the project is interested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69341</commentid>
    <comment_count>1</comment_count>
    <who name="Daniela Plascencia">daniela.plascencia</who>
    <bug_when>2016-12-22 18:42:28 +0000</bug_when>
    <thetext>The check at patchtest-oe has now changed from its first version, but I&apos;m currently facing two issues with pylint&apos;s execution within the patchtest environment:

- Pylint throwing import errors. 

If we take, for instance poky/bitbake/lib/bb/command.py, the imports are done as:

import bb.event
import bb.cooker
import bb.remotedata

In order to test it, Pylint runs &apos;command.py&apos; inside &apos;bb/&apos;, which indeed causes a Python ImportError, and thus the check fails, meaning all patches having files importing modules in such fashion will be marked as failures. We must find a way to handle these files.

- Pylint&apos;s message template is already defined at epylint.py (/usr/lib/python2.7/site-packages/pylint/epylint.py)

The pylint check at patchtest-oe uses the py_run method from epylint.py to be ran. The content at epylint defines Pylint&apos;s message template, which is the way the results are displayed to the user and can be modified to show certain information(e.g. line number, type of error) [1], but the latter can be done only from epylint.py. We must find a way to set the msg-template from within the check at patchtest-oe.

[1] https://docs.pylint.org/en/1.6.0/output.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69369</commentid>
    <comment_count>2</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-12-23 16:06:14 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The check at patchtest-oe has now changed from its first version, but I&apos;m
&gt; currently facing two issues with pylint&apos;s execution within the patchtest
&gt; environment:
&gt; 
&gt; - Pylint throwing import errors. 
&gt; 
&gt; If we take, for instance poky/bitbake/lib/bb/command.py, the imports are
&gt; done as:
&gt; 
&gt; import bb.event
&gt; import bb.cooker
&gt; import bb.remotedata
&gt; 
&gt; In order to test it, Pylint runs &apos;command.py&apos; inside &apos;bb/&apos;, which indeed
&gt; causes a Python ImportError, and thus the check fails, meaning all patches
&gt; having files importing modules in such fashion will be marked as failures.
&gt; We must find a way to handle these files.
&gt; 

Let&apos;s ignore import errors. pylint is not being run from the bitbake script, so this is the reason that the PYTHONPATH is not set and some libraries cannot be found.

&gt; - Pylint&apos;s message template is already defined at epylint.py
&gt; (/usr/lib/python2.7/site-packages/pylint/epylint.py)
&gt; 
&gt; The pylint check at patchtest-oe uses the py_run method from epylint.py to
&gt; be ran. The content at epylint defines Pylint&apos;s message template, which is
&gt; the way the results are displayed to the user and can be modified to show
&gt; certain information(e.g. line number, type of error) [1], but the latter can
&gt; be done only from epylint.py. We must find a way to set the msg-template
&gt; from within the check at patchtest-oe.

Right. we should not touch the python-pylint module. Please ask the pylint community if you need info about it.

&gt; 
&gt; [1] https://docs.pylint.org/en/1.6.0/output.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69554</commentid>
    <comment_count>3</comment_count>
    <who name="Daniela Plascencia">daniela.plascencia</who>
    <bug_when>2017-01-05 21:17:50 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; The check at patchtest-oe has now changed from its first version, but I&apos;m
&gt; &gt; currently facing two issues with pylint&apos;s execution within the patchtest
&gt; &gt; environment:
&gt; &gt; 
&gt; &gt; - Pylint throwing import errors. 
&gt; &gt; 
&gt; &gt; If we take, for instance poky/bitbake/lib/bb/command.py, the imports are
&gt; &gt; done as:
&gt; &gt; 
&gt; &gt; import bb.event
&gt; &gt; import bb.cooker
&gt; &gt; import bb.remotedata
&gt; &gt; 
&gt; &gt; In order to test it, Pylint runs &apos;command.py&apos; inside &apos;bb/&apos;, which indeed
&gt; &gt; causes a Python ImportError, and thus the check fails, meaning all patches
&gt; &gt; having files importing modules in such fashion will be marked as failures.
&gt; &gt; We must find a way to handle these files.
&gt; &gt; 
&gt; 
&gt; Let&apos;s ignore import errors. pylint is not being run from the bitbake script,
&gt; so this is the reason that the PYTHONPATH is not set and some libraries
&gt; cannot be found.
&gt; 

Ok. Adding the option to ignore import errors will solve this issue.

&gt; &gt; - Pylint&apos;s message template is already defined at epylint.py
&gt; &gt; (/usr/lib/python2.7/site-packages/pylint/epylint.py)
&gt; &gt; 
&gt; &gt; The pylint check at patchtest-oe uses the py_run method from epylint.py to
&gt; &gt; be ran. The content at epylint defines Pylint&apos;s message template, which is
&gt; &gt; the way the results are displayed to the user and can be modified to show
&gt; &gt; certain information(e.g. line number, type of error) [1], but the latter can
&gt; &gt; be done only from epylint.py. We must find a way to set the msg-template
&gt; &gt; from within the check at patchtest-oe.
&gt; 
&gt; Right. we should not touch the python-pylint module. Please ask the pylint
&gt; community if you need info about it.

The issue with the message template is now tracked at https://github.com/PyCQA/pylint/issues/1269.

&gt; 
&gt; &gt; 
&gt; &gt; [1] https://docs.pylint.org/en/1.6.0/output.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70127</commentid>
    <comment_count>4</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-01-25 16:43:55 +0000</bug_when>
    <thetext>pylint check is not ready so moving to the M3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71314</commentid>
    <comment_count>5</comment_count>
    <who name="Daniela Plascencia">daniela.plascencia</who>
    <bug_when>2017-03-15 18:41:41 +0000</bug_when>
    <thetext>Merged at http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe/commit/?id=4ec89dbcecece16562f5bdf0301a9231c2292f78</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>