test-fullautomation / robotframework

Generic automation framework for acceptance testing and RPA
http://robotframework.org
Apache License 2.0
1 stars 0 forks source link

Reporting incomplete on log level USER #90

Open HolQue opened 2 months ago

HolQue commented 2 months ago

A test suite is executed in log level USER. Outcome: The log files contain USER messages only, nothing else (like expected). We also have no ERRORS and no WARNINGS in this case.

At end of execution I get the following error message:

[ ERROR ] Reading XML source '.... .robot.xml' failed: Incompatible child element 'msg' for 'suite'.

The log files in HTML format are missing.

Curious, while developing the log level USER feature I never observed this error. Something must be different now. I currently do not know, what.

HolQue commented 2 months ago

Not able to reproduce this error any more.

Whyle trying to recover the original test setup I observed another error.

The following code is executed with log level USER:

THREAD    TEST_THREAD_1     False
   Log     ================= I am TEST_THREAD_1    USER    console=no
END

Result:

Exception in thread TEST_THREAD_1:
KeyError: 'TEST_THREAD_1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\workplace\RobotFramework\python39\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\workplace\RobotFramework\python39\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\workplace\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\bodyrunner.py", line 549, in run_worker
    self._context.variables.end_thread()
  File "C:\workplace\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\statusreporter.py", line 67, in __exit__
    raise failure
robot.errors.HandlerExecutionFailed: KeyError: 'TEST_THREAD_1'

But all log files are created properly.

HolQue commented 2 months ago

I was able to recover the test setup that reproduces the first error. In this setup a Python keyword library is involved.

It seems to me now that we have two different error scenarios:

  1. Log keyword with log level USER is used immediately within a robot file.
  2. Log keyword with log level USER is used within a Python keyword library.

I will take a deeper look now at option 2.