buda-base / asset-manager

Asset Manager and audit tool
The Unlicense
0 stars 0 forks source link

Rename Work run files if a test contains ErrorsAsWarnings errors #162

Closed jimk-bdrc closed 2 years ago

jimk-bdrc commented 2 years ago

Background

v0.9 of Audit tool created the pattern of a non-fatal error. Prior to this, any test which failed was marked as a failure. The user can control this with the shell.properties property ErrorsAsWarning by giving a list of test failure outcomes (the complete list is given in the default shell.properties) which are considered as warnings. These numbers represent one file which has failed one test

The issue

Audit tool emits one results file for each work it processes. It renames the file to have a prefix of PASS FAIL WARN, depending on Resulting Prefix Condition
PASS No errors at all were found
PASS All the errors for a test were included in the ErrorsAsWarnings property.
In that case, all the files which failed on that error are listed in the work run log file (see below)
WARN A test was not run (skipped) because the folder was not present.
FAIL A work failed errors which were not excluded in the ErrorsAsWarnings property.

How warnings appear

These examples show how a work with thumbnails in web images appears when ErrorsAsWarnings contains the error to override ( INVALID_IMAGE_THUMBNAIL = 118)

Screen

INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        File Size Test
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        Image Valid EXIF Test
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        No Files in Root Folder
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        Web Image Attributes
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        File Sequence Test
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        Archive Valid EXIF Test
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        Archive EXIF Thumbnail Test
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        No folders allowed in Image Group folders
INFO  Passed    /Users/jimk/prod/am125/W1NLM2232        Image EXIF Thumbnail Test

Work run log:

W1NLM2232,Image EXIF Thumbnail Test,Passed,,,/Users/jimk/prod/am125/W1NLM2232
,,,118,Archive Image file /Users/jimk/prod/am125/W1NLM2232/images/W1NLM2232-I1NLM2232_001/I1NLM2232_0010202.jpg contains thumbnail,/Users/jimk/prod/am125/W1NLM2232
,,,118,Archive Image file /Users/jimk/prod/am125/W1NLM2232/images/W1NLM2232-I1NLM2232_001/I1NLM2232_0010216.jpg contains thumbnail,/Users/jimk/prod/am125/W1NLM2232
,,,118,Archive Image file /Users/jimk/prod/am125/W1NLM2232/images/W1NLM2232-I1NLM2232_001/I1NLM2232_0010028.jpg contains thumbnail,/Users/jimk/prod/am125/W1NLM2232

Notice that the screen and the run log record the test as passed, but list files which did not pass the specific test.

This issue

Proposed that in the second case, where errors are found, but they are in the Errors As Warnings property, that the test gets marked as WARN and the resulting run log file gets renamed as WARN-W1XXXnnnnn-

jimk-bdrc commented 2 years ago

Implemented in #163 and deployed onto bodhi 18 Apr 2022