Skip to content

Possibility to configure number of error message lines in reports #2576

Closed

Description

@mchfrnc

Hi. I have a test, where I’m expecting keyword’s fail, which causes another keyword’s fail and I would like to catch a full (long) error message generated by the first one. But I met an limitation of maximum number of error lines visible.
Please see the following issue: https://code.google.com/archive/p/robotframework/issues/340
As far as I know it is impossible to change maximum error lines during execution from CLI.
The only way is to change it directly in the Robot Framework source code, http://robot-framework.readthedocs.org/en/2.9.1/_modules/robot/utils/text.html, and setting _MAX_ERROR_LINES variable.

My temporary workaround is to use sed in cron (it is executed very often to avoid situation, when after some updates we have MAX_ERROR_LINES set back to 40):

sudo sed -i 's/_MAX_ERROR_LINES = 40/_MAX_ERROR_LINES = 999/g' /usr/local/lib/python2.7/dist-packages/robot/utils/text.py

Activity

  1. pekkaklarck commented on Apr 12, 2017

    @pekkaklarck
    Member

    Do you propose making this configurable somehow? I'm OK with that but it needs someone to provide a PR.

  2. mchfrnc commented on Apr 12, 2017

    @mchfrnc
    Author

    In my opinion there is no need to make it configurable, for example, with a new additional Robot's argument. I would say, if user sets --loglevel TRACE it means that he wants to have as much logs as possible, so maybe a good idea is to set _MAX_ERROR_LINES to 999 lines (or whatever, bigger number) when loglevel is set to TRACE and some smaller number when loglevel is set to INFO.

  3. pekkaklarck commented on Apr 12, 2017

    @pekkaklarck
    Member

    I don't think log level should affect this. You already now see the full error message in the log file regardless the log level you use.

  4. added this to the v3.1 milestone on Apr 23, 2018
  5. changed the title [-]Hardcoded value of _MAX_ERROR_LINES variable[/-] [+]Possibility to configure number of error message lines in reports[/+] on Oct 10, 2018
  6. pekkaklarck commented on Oct 10, 2018

    @pekkaklarck
    Member

    PR #2589 adds new --maxerrorlines option that allows configuring the number of error message lines in reports. There are some changes still required before the PR can be merged, but I don't see problems getting it into RF 3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions