test-fullautomation / robotframework-testsuitesmanagement

Apache License 2.0
4 stars 2 forks source link

Missing JSON file info in case of errors #274

Closed HolQue closed 6 months ago

HolQue commented 6 months ago

In case of errors while loading the configuration, the path and name of the affected JSON file is not printed to debug log file any more:

ERROR - Slicing is not supported! Please update the expression '${params.global.param1}[-1]'.
UNKNOWN - Loading of JSON configuration file failed!
ERROR - Verification against JSON schema failed: 'Additional properties are not allowed ('testdict4' was unexpected)'. Please put the additional params into 'params': { 'global': {...}
UNKNOWN - Verification against JSON schema failed: 'Additional properties are not allowed ('testdict4' was unexpected)'. Please put the additional params into 'params': { 'global': {...}
ERROR - A substitution in key names is not allowed! Please update the key name "par${...}am2"
UNKNOWN - Loading of JSON configuration file failed!

This should be restored. Expected is something like:

ERROR - Expecting property name enclosed in double quotes: line 18 column 46 (char 598)
ERROR - Nearby: '... "]},\n                           "019" : {"020" : {: : "022"}}\n         ...'
ERROR - In file: 'D:/tmp_files/config/testconfig.json'
UNKNOWN - Loading of JSON configuration file failed!
namsonx commented 6 months ago

Hello Holger,

An error message like:

ERROR - Expecting property name enclosed in double quotes: line 18 column 46 (char 598)
ERROR - Nearby: '... "]},\n                           "019" : {"020" : {: : "022"}}\n         ...'

is just printed if there is an syntax error in a JSON configuration file while loading a configuration file.

In the case you mentioned in this ticket, the error is raised by our JsonPreprocessor package that Slicing is not supported! Please update the expression '${params.global.param1}[-1]'.

So, in this situation we just need to log out the path of the configuration file if needed.

Thank you, Son

HolQue commented 6 months ago

Hi Son,

I wrote "... something like...". This is an example only. Simply print out the information that is available. And available should be at least the affected JSON file (like in the past).

namsonx commented 6 months ago

Hello Holger,

I pushed the change to stabi branch to update error log message when loaded configuration failed. I also update the reference logs of selftest.

Thank you, Son

HolQue commented 6 months ago

Hi Son,

in log files I still get errors like

ERROR - Slicing is not supported! Please update the expression '${stringval}[1:]'.
UNKNOWN - Unable to load the test configuration. The test execution will be aborted!

With path and name of affected JSON file are still missing.

Some TestsuitesManagement/JsonPreprocessor versions ago every error in a configuration file caused to print path and name of the affected configuration file to log file. In between this disappeared.

You should check what went wrong in the code within the last weeks and you should restore the missing information.

namsonx commented 6 months ago

Hello Holger,

Thank you for your finding! I pushed commit 59946bae1b9 to solve your review comment.

Thank you, Son

HolQue commented 6 months ago

Hooray - the missing file is back!

test-fullautomation commented 6 months ago

Released with RobotFramework AIO 0.12.0