<?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>15073</bug_id>
          
          <creation_ts>2023-03-16 19:10:13 +0000</creation_ts>
          <short_desc>Add ptest for less</short_desc>
          <delta_ts>2023-09-01 00:34:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>4.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>NEWCOMER</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>4.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Randy MacLeod">randy.macleod</reporter>
          <assigned_to name="Julien Stephan">jstephan</assigned_to>
          <cc>frank.wolff</cc>
    
    <cc>jstephan</cc>
    
    <cc>loc.nguyen.wt</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>nat.bailey</cc>
    
    <cc>yoann.congal</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>95159</commentid>
    <comment_count>0</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-03-16 19:10:13 +0000</bug_when>
    <thetext>The less package has some test code:

https://github.com/gwsw/less

❯ ls lesstest/
display.c  env.c  lesstest.c  lesstest.h  log.c  lt  lt_screen.c  lt_types.h  Makefile  maketest  parse.c  pipeline.c  README  run.c  runtest  term.c  unicode.c  wchar.c  wchar.h

but out recipe doesn&apos;t exercise it:
https://git.openembedded.org/openembedded-core/tree/meta/recipes-extended/less/less_608.bb

Action: compile, install and run the tests in the ptest system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95167</commentid>
    <comment_count>1</comment_count>
    <who name="Frank Wolff">frank.wolff</who>
    <bug_when>2023-03-20 09:07:47 +0000</bug_when>
    <thetext>Hi Randy,

I&apos;m planning on working on this bug as a newcomer and I&apos;ve got a question.
The less recipe gets the tar archive from greenwoodsoftware.com and not from github.com
The lesstest folder is only available on Github repository. So should we change the SRC_URI to Github ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95169</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-03-20 14:08:51 +0000</bug_when>
    <thetext>Hi Frank, 
Thanks for working on this!

I&apos;d start with an email to the maintainer to see if they would consider bundling the tests with the release tarball. If they don&apos;t want to do that then, yes switch to the github SRC_URI but mention in your commit log that the upstream did not want to bundle the tests.

The tarballs are smaller but the less git history isn&apos;t that much of an overhead.


❯ ls -l 
total 364
drwxr-xr-x 2 rmacleod rmacleod   4096 Jul 22  2022 less-608
-rw-rw-r-- 1 rmacleod rmacleod 362346 Jul 22  2022 less-608.tar.gz
drwxrwxr-x 6 rmacleod rmacleod   4096 Mar 20 10:04 less.git

os/core/less 
❯ du -sh less-608
1.6M	less-608

os/core/less 
❯ du -sh less.git/
8.9M	less.git/


Good luck.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95261</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-03-31 20:01:12 +0000</bug_when>
    <thetext>Hey Frank, I came across this issue in my email -  any news? 
Let me know if you need help at all.
../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95667</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-08 15:41:18 +0000</bug_when>
    <thetext>Frank, I&apos;ve CCed Nat who may be interested in working on this enhancement if you don&apos;t have time. What&apos;s happening?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95668</commentid>
    <comment_count>5</comment_count>
    <who name="Frank Wolff">frank.wolff</who>
    <bug_when>2023-06-08 15:47:34 +0000</bug_when>
    <thetext>Hi Randy,
sorry I totally forgot to answer you last time. Sadly I&apos;ve been caught in other projects and don&apos;t have enough time right now to work on this.
FYI there&apos;s an issue about this on less Github repository : https://github.com/gwsw/less/issues/344</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95671</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-08 16:50:41 +0000</bug_when>
    <thetext>Thanks Frank and everyone checking on this.
It looks like v635 and other recent github tarballs have the lesstest content. Does someone want to check since Frank is busy?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95879</commentid>
    <comment_count>7</comment_count>
    <who name="Loc Nguyen">loc.nguyen.wt</who>
    <bug_when>2023-07-04 05:05:41 +0000</bug_when>
    <thetext>Hi Randy,
I&apos;m willing to help on this bug. As my understanding, the steps will be:
1. try to compile and run this test manually
2. modifying recipe to add -ptest package. (refer: https://wiki.yoctoproject.org/wiki/Ptest)
3. Verifying by adding CORE_IMAGE_EXTRA_INSTALL += &quot;less-ptest&quot; to conf file, bitbake and run &quot;ptest-runner&quot; in the target.

Is there anything missing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95880</commentid>
    <comment_count>8</comment_count>
    <who name="Julien Stephan">jstephan</who>
    <bug_when>2023-07-04 08:11:29 +0000</bug_when>
    <thetext>Hi Randy and Loc,

Hi also started to have a look yesterday at this issue as a newcomer to the yocto project. I wanted to take a look around to this issue before posting. I almost have a patch ready for this issue. I am able to run the lesstest test but I have two failing tests (I am currently looking at this right now): 

``
TEST version.c.lt
OK   version.c (38 steps)
TEST utf8-2.txt.lt
FAIL utf8-2.txt on cmd #20 (. a)
FAIL utf8-2.txt (20 steps)
ERR  status 256 from /usr/lib/less/ptest/lesstest -s &apos;/usr/lib/less/ptest/lt_screen&apos; -t /usr/lib/less/ptest/lt/chinese1.lt&apos; &apos;/usr/bin/less&apos; 
TEST table-50x200.lt
OK   table-50x200 (467 steps)
TEST seq200.lt
OK   seq200 (18 steps)
TEST proc-special.lt
OK   proc-special (107 steps)
TEST hdr-unicode1.lt
OK   hdr-unicode (107 steps)
TEST hdr-unicode.lt
OK   hdr-unicode (164 steps)
TEST github329.lt
OK   github329 (28 steps)
TEST github265.lt
OK   github265 (17 steps)
TEST github216.lt
OK   github216 (143 steps)
TEST colorbars.lt
OK   colorbars (222 steps)
TEST chinese1.lt
FAIL chinese1 on cmd #29 (. a)
FAIL chinese1 (29 steps)
ERR  status 256 from /usr/lib/less/ptest/lesstest -s &apos;/usr/lib/less/ptest/lt_screen&apos; -t /usr/lib/less/ptest/lt/chinese1.lt&apos; &apos;/usr/bin/less&apos; 
RAN  12 tests with 2 errors
``

Best 
Julien</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95883</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-04 21:54:19 +0000</bug_when>
    <thetext>Julien and Luc,

The steps listed seem reasonable.

If you can&apos;t get all the ptests to pass with the time you have at hand, 
please just submit the recipe changes to the list anyway with a good summary of the current state and we&apos;ll work it out over time.

Some tests are better than no tests!

../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95885</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-05 15:59:16 +0000</bug_when>
    <thetext>Luc, Julien,

There are 10s (?) more recipes that don&apos;t have ptest coverage in oe-core and many in other layers. Do you want to work on one?
 
Here&apos;s a quick filter that will likely miss some recipes where the ptest support is in a .inc file:

oe-core.git on  master [$] 
❯ for i in `find . -name &quot;*.bb&quot; | grep -v class`; do echo -n $i &quot;: &quot;;grep  -q ptest $i; echo $?; done | rg &quot;: 0&quot; | wc -l
112

but it&apos;s a good starting point.

We could organize this into a top level enhancement and track each recipe as a sub-activity or y&apos;all could just pick on and send a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95886</commentid>
    <comment_count>11</comment_count>
    <who name="Loc Nguyen">loc.nguyen.wt</who>
    <bug_when>2023-07-06 07:15:46 +0000</bug_when>
    <thetext>Hi Julien, Randy

Since Julien have started, I&apos;ll look into other bugs. 
Thank you for your notification.

Good luck</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95887</commentid>
    <comment_count>12</comment_count>
    <who name="Julien Stephan">jstephan</who>
    <bug_when>2023-07-06 07:57:04 +0000</bug_when>
    <thetext>Hi Randy,

yes I would be happy to help on such task. Let me know how. 
In the meantime, I already sent the patch for less and I am trying to figure out the locale issue related to the 2 failing tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95889</commentid>
    <comment_count>13</comment_count>
    <who name="Julien Stephan">jstephan</who>
    <bug_when>2023-07-06 13:57:19 +0000</bug_when>
    <thetext>As pointed out by Alexander Kanavin (https://lists.openembedded.org/g/openembedded-core/message/183922) less has a weird version scheme on its github repository so we should postpone this until lesstest code gets bundled into the release tarballs. 

The latest version of my work is available here: https://lists.openembedded.org/g/openembedded-core/message/183943 and I pushed my branch on poky-contrib: https://git.yoctoproject.org/poky-contrib/commit/?h=jstephan/add-ptest-for-less

All tests pass (locale issues described above are fixed).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96289</commentid>
    <comment_count>14</comment_count>
    <who name="Julien Stephan">jstephan</who>
    <bug_when>2023-08-21 14:41:35 +0000</bug_when>
    <thetext>release tarballs now include lesstest, so I sent a v5 of this series to upgrade less and add ptest https://lists.openembedded.org/g/openembedded-core/message/186446</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96336</commentid>
    <comment_count>15</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-09-01 00:34:23 +0000</bug_when>
    <thetext>And it&apos;s merged to master!

https://git.openembedded.org/openembedded-core/commit/?id=1d20e7990656c2135570640a329c80b7df879675

Thanks Julien!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>