action #167932
closedcoordination #127031: [saga][epic] openQA for SUSE customers
coordination #130414: [epic] Improved code coverage in os-autoinst
Cover code of os-autoinst path needle.pm fully (statement coverage) size:S
Description
Acceptance criteria¶
- AC1: the path needle.pm is listed in codecov.yml under "fully_covered"
Suggestions¶
- Take a look into https://app.codecov.io/gh/os-autoinst/os-autoinst/blob/master/needle.pm about what is missing
- Add unit test statement coverage for that to bump the target
Updated by okurz 5 months ago
- Copied from action #167929: Cover code of os-autoinst path testapi.pm fully (statement coverage) size:M added
Updated by okurz 5 months ago
- Copied to action #167935: Cover code of os-autoinst path myjsonrpc.pm fully (statement coverage) size:S added
Updated by gpuliti about 2 months ago
- Status changed from In Progress to Feedback
I added 2 test to cover save and tags subroutine, but I got errors while creating new needles and checking for updated args, see diff of the 2 new test.
I'm wondering why I get Can't call method "save" on unblessed reference at t/01-test_needle.t line 554.
for the save and Needle test1.json is not under needle directory /tmp/wHdVRbLc0o at /home/wabri/Workspaces/Github-Wabri/OS-Autoinst/os-autoinst/wt2/needle.pm line 60.
for tags. I need to test, but I think for the tags test I need to create those json I'm using.
Updated by tinita about 2 months ago
I think the save
method is not used at all.
I found a PR from 2019 that did an incorrect change there: https://github.com/os-autoinst/os-autoinst/pull/1153/files#r1906147139
That would have been noticed if it was used.
And the last usage was removed in 2013:
https://github.com/os-autoinst/os-autoinst/commit/525b71d5c8d86cc009af730003a6ebea47660f11
Updated by tinita about 2 months ago
gpuliti wrote in #note-10:
I'm wondering why I get
Can't call method "save" on unblessed reference at t/01-test_needle.t line 554.
for the save
Because needle->new
actually returned undef in that case, and then you treated the variable as a hashref, so it ends up as a hashref, but not blessed, so not a "needle" object.
Updated by tinita about 2 months ago ยท Edited
I found another problem which is responsible for the missing warning that you should have gotten for the undefined needle: https://github.com/os-autoinst/os-autoinst/pull/1570/files#r1906157649
https://github.com/os-autoinst/os-autoinst/pull/2613 Fix warn+return precendence
Updated by gpuliti about 2 months ago
- % Done changed from 0 to 100
thanks @tinita for the feedback, I've updated the pr https://github.com/os-autoinst/os-autoinst/pull/2603
Updated by gpuliti about 2 months ago
- Status changed from Feedback to In Progress
Updated by gpuliti about 2 months ago
- Status changed from In Progress to Feedback
Updated by gpuliti about 2 months ago
- Status changed from Feedback to In Progress
it seems even the coverage is not 100% => https://github.com/os-autoinst/os-autoinst/pull/2598#issuecomment-2586346483 + https://app.codecov.io/gh/os-autoinst/os-autoinst/blob/master/needle.pm
I'm going to fix the missing lines
Updated by gpuliti about 2 months ago
- Status changed from In Progress to Feedback
I've added 2 test to check when more than 2 tags are passed to needle::tags subroutine https://github.com/os-autoinst/os-autoinst/pull/2620
Updated by gpuliti about 2 months ago
Failing during the fullstack job: https://github.com/os-autoinst/os-autoinst/actions/runs/12795434702/job/35672901801
it seems that it can't find perl-DBI-1.645.0
:
+ sudo zypper -n install --download-only bsdtar-3.7.2 chrony-4.1 chrony-pool-openSUSE-4.1 cmark-0.30.2 hostname-3.16 jq-1.6 libcmark0_30_2-0.30.2 libjq1-1.6 libonig4-6.7.0 libssh2-1-1.11.0 lsof-4.99.0 openssh-common-9.6p1 optipng-0.7.8 perl-Algorithm-C3-0.11 perl-Algorithm-Diff-1.1903 perl-aliased-0.34 perl-App-cpanminus-1.7047 perl-Archive-Zip-1.60 perl-B-Hooks-EndOfScope-0.21 perl-B-Keywords-1.26 perl-BSD-Resource-1.2911 perl-Capture-Tiny-0.48 perl-Carp-Always-0.16 perl-Carp-Clan-6.06 perl-Class-Accessor-0.51 perl-Class-Accessor-Grouped-0.10014 perl-Class-C3-0.35 perl-Class-C3-Componentised-1.001002 perl-Class-Data-Inheritable-0.08 perl-Class-Factory-Util-1.7 perl-Class-Inspector-1.32 perl-Class-Load-0.25 perl-Class-Load-XS-0.10 perl-Class-Method-Modifiers-2.12 perl-Class-Singleton-1.5 perl-Class-Tiny-1.006 perl-Class-XSAccessor-1.19 perl-Clone-0.46 perl-Clone-Choose-0.010 perl-Code-TidyAll-0.83 perl-CommonMark-0.290000 perl-Config-Any-0.33 perl-Config-INI-0.029 perl-Config-IniFiles-2.94 perl-Config-Tiny-2.
Loading repository data...
Reading installed packages...
Package 'perl-DBI-1.645.0' not found.
Error: Process completed with exit code 104.
Updated by gpuliti about 2 months ago
Pipeline passed and needed rewiew: https://github.com/os-autoinst/os-autoinst/pull/2620
Code coverage 100% https://app.codecov.io/gh/os-autoinst/os-autoinst/pull/2620/indirect-changes
Updated by gpuliti about 2 months ago
- Status changed from Feedback to Resolved
- % Done changed from 90 to 100