test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

Invalid error message #163

Closed HolQue closed 3 months ago

HolQue commented 8 months ago

The JSON code

"teststring" : "eins",
"${teststring}___${teststring}" : "zwei"

causes:

'Setting value 'zwei' for parameter 'str(eins)___str(eins)' is not permissible when substituting parameters of composite data types in dictionary key names!'

But expected is:

{'eins___eins': 'zwei', 'teststring': 'eins'}

HolQue commented 8 months ago

Another impact:

The same code in context of TestsuitesManagement:

"params" : {
   "global" : {
      "teststring" : "eins",
      "${params.global.teststring}___${params.global.teststring}" : "zwei",

causes:

[ ERROR ] Loading of JSON configuration file failed!
          Reason: The variable '${params}['global']['teststring'])___str(${params}['global']['teststring']' is not available!

Even in case of the code has the same structure, the error messages are rather different. But I would expect that the error message coming from TestsuitesManagement gives the same statement like the error message coming from JsonPreprocessor.

The error message coming from TestsuitesManagement again contains parts of internal data structures:

)___str(

This should be avoided in error messages provided to users.

But nevertheless: In both cases returned values are expected, instead of error messages.

namsonx commented 7 months ago

Hello Holger,

I pushed new commit c8720a9bc to stabi branch to fix this issue.

Thank you, Son

HolQue commented 7 months ago

Issue solved in JsonPreprocessor, but not in TestsuitesManagement.

TestsuitesManagement still throws error:

[ ERROR ] Loading of JSON configuration file failed!
          Reason: The variable '${params}['global']['teststring']___${params}['global']['teststring']' is not available!
namsonx commented 6 months ago

Hello Holger,

Thank you for your finding! I pushed the new commit c12257b2ae to stabi branch to fix the issue you mention above.

Thank you, Son

HolQue commented 6 months ago

Retest with latest versions not successful. Still got error message:

The variable '${params}['global']['teststring']___${params}['global']['teststring']' is not available!

namsonx commented 6 months ago

Hello Holger,

I tested, and it worked fine on stabi branch, I still not create a pull-request to develop yet.

Thank you, Son

test-fullautomation commented 5 months ago

Hi Son, what is the status of this issue? Thank you, Thomas

HolQue commented 5 months ago

Retest successful. Issue can be closed.