Project

General

Profile

action #137105

Updated by tinita 8 months ago

Handle Perl deprecation warning messages gracefully (was: auto_review:"Test died: Can.t locate object method.*spew.*via package.*Mojo::File":retry) 

 ## Observation 

 We had those warnings in our tests, making the tests fail because we use Test::Warnings which makes warnings fatal: 
 ``` 
 #     Failed test 'no (unexpected) warnings (via done_testing)' 
   at ./t/03-testapi.t line 1105. 
 # Got the following unexpected warnings: 
 #     1: Mojo::File::spurt is deprecated in favor of Mojo::File::spew at /home/abuild/rpmbuild/BUILD/os-autoinst-4.6.1694444383.e6a5294/basetest.pm line 433. 
 ``` 

 ## Old ticket observation 

 openQA test in scenario sle-15-SP2-EC2-SAP-PAYG-Incidents-saptune-x86_64-sles4sap_gnome_saptune_overrides@ec2_r5.8xlarge fails in 
 [1_saptune_overrides](https://openqa.suse.de/tests/12214360/modules/1_saptune_overrides/steps/1323) 
 ``` 
 [2023-09-22T17:20:41.791523+02:00] [info] [pid:34354] ::: basetest::runtest: # Test died: Can't locate object method "spew" via package "Mojo::File" at /usr/share/openqa/lib/OpenQA/Parser/Result/Output.pm line 17. 
 ``` 
 Test is from 2023-09-22T15:08:42, worker30. 
 currently the correct version of Mojolicious (9.340.0) is installed on that worker. 


 ## Reproducible 

 Fails since (at least) Build [:30275:vim](https://openqa.suse.de/tests/12214360) (current job) 

 Find jobs referencing this ticket with the help of 
 https://raw.githubusercontent.com/os-autoinst/scripts/master/openqa-query-for-job-label , 
 for example to look for ticket 12345 call `openqa-query-for-job-label poo#12345` 



 ## Expected result 

 Last good: [:30549:kernel-docs](https://openqa.suse.de/tests/12048393) (or more recent) 


 ## Acceptance Criteria 
 * **AC1**: OBS builds don't fail due to unexpected deprecation messages 

 ## Further details 

 Always latest result in this scenario: [latest](https://openqa.suse.de/tests/latest?arch=x86_64&distri=sle&flavor=EC2-SAP-PAYG-Incidents-saptune&machine=ec2_r5.8xlarge&test=sles4sap_gnome_saptune_overrides&version=15-SP2) 

 ## Suggestions 
 * Look into zypper logs if a new openQA version was installed before Mojolicious was updated 
 * Extend perl-Test-Warnings to be able to categorize and exclude deprecation warnings 
 * Submit new version to Tumbleweed, submit temporarily to devel:openQA:Leap:… as well as Leap maintenance 
 * disable fatal warnings in OBS build 
 * Optional: Try out how to use it in CI, e.g. variables 
 * Require the new version in our code os-autoinst+openQA 

 ## Findings / Steps 
 * Test died because old Mojolicious version was loaded, meanwhile perl packages updated, and new openQA code loaded with `require` using the method of the new Mojolicious version 
 * Test::Warnings 0.32.0 now supports PERL_TEST_WARNINGS_ONLY_REPORT_WARNINGS and was linked to devel:openQA:Leap:15.* 
 * TODO Try it out and document how to use it if such a case happens again

Back