Skip to content

Commit

Permalink
Merge pull request #269 from test-fullautomation/namsonx/task/stabi_b…
Browse files Browse the repository at this point in the history
…ranch

Namsonx/task/stabi branch
  • Loading branch information
test-fullautomation authored Apr 11, 2024
2 parents e330c63 + 24b714f commit 60a8d00
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
13 changes: 7 additions & 6 deletions RobotFramework_TestsuitesManagement/Config/CConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ def loadCfg(self):
except Exception as error:
CConfig.bLoadedCfg = False
CConfig.sLoadedCfgError = ''
for item in str(error).split(': \''):
CConfig.sLoadedCfgError += f"{item}\n "
logger.error(f"Loading of JSON configuration file failed! Reason: {CConfig.sLoadedCfgError}")
for line in str(error).splitlines():
logger.error(f"{line}") # outcome: every single line starts with timestamp and log level
CConfig.sLoadedCfgError += f"{line}\n " # to be compatible with original version
BuiltIn().unknown('Loading of JSON configuration file failed!')
raise Exception

Expand Down Expand Up @@ -534,9 +534,10 @@ def __loadConfigFileLevel2(self) -> bool:
except Exception as error:
CConfig.bLoadedCfg = False
CConfig.sLoadedCfgError = ''
for item in str(error).split(': \''):
CConfig.sLoadedCfgError += f"'{item}', "
logger.error(f"Loading of JSON configuration file failed! Reason: {CConfig.sLoadedCfgError}")
for line in str(error).splitlines():
logger.error(f"{line}") # outcome: every single line starts with timestamp and log level
CConfig.sLoadedCfgError += f"{line}\n " # to be compatible with original version / but when the error is already logged, for what do we need to store the error message in sLoadedCfgError?
logger.error('Loading of JSON configuration file failed!')
return False
sListOfVariants = ''
for item in list(oSuiteConfig.keys()):
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions RobotFramework_TestsuitesManagement/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
#
# Version and date of package RobotFramework_TestsuitesManagement
#
VERSION = "0.7.6"
VERSION_DATE = "01.04.2024"
VERSION = "0.7.7"
VERSION_DATE = "10.04.2024"
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
| ``\u007d``

Finally, the value of ``var1`` is 2 and the value of ``var2`` is 3.

* Extended debugging support:

In case of JSON syntax errors in configuration files, the **Robot Framework** log files contain an extract of the JSON content nearby the position, where the error occurred.
Line breaks in JSON content are replaced by '``\\n``' in log output.

| ``ERROR - Expecting ',' delimiter: line 10 column 1 (char 246)``
| ``ERROR - Nearby: '... arams\" : \u007b\\n \"global\": \u007b\\n\"param1\" : 1\\n\"param2\" : 2\\n ...'``

"
]
}
Expand Down
3 changes: 3 additions & 0 deletions packagedoc/additional_docs/History.tex
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@
\historychange{- Added naming convention check for parameter names.\newline
- Updated logging message.}

\historyversiondate{0.7.7}{04/2024}
\historychange{Extended debugging support. In case of JSON syntax errors in configuration files, the Robot Framework log files contain an extract of the JSON content nearby the position, where the error occurred.}

\end{packagehistory}
6 changes: 3 additions & 3 deletions test/testtools/GenSnippetsTSM.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#
# **************************************************************************************************************
#
VERSION = "0.2.0"
VERSION_DATE = "19.03.2024"
VERSION = "0.2.1"
VERSION_DATE = "10.04.2024"
#
# **************************************************************************************************************

Expand Down Expand Up @@ -325,7 +325,7 @@ def __init__(self, oConfig=None, oCounter=None, oLogger=None):
# error indicators, used while parsing relevant content from Robot Framework debug log file and used to define the text color
self.__listErrorIndicators = ["ERROR", "Error", "error", "UNKNOWN", "unknown", "FAIL", "failed", "AssertionError",
"Expecting", "expecting", "Expected", "expected", "Unexpected", "unexpected", "Invalid", "invalid", "Reason",
"not found", "have to be", "does not support", "No closing quotation", "Missing", "missing"]
"not found", "have to be", "does not support", "No closing quotation", "Missing", "missing", "Nearby"]

# filter strings, used while parsing relevant content from Robot Framework debug log file
self.__sInfoIndicators = ";".join(self.__listInfoIndicators)
Expand Down

0 comments on commit 60a8d00

Please sign in to comment.