Skip to content

Arguments to keywords executed with 'Run Keyword' variants should be resolved later #67

Closed

Description

@spooning

Originally submitted to Google Code by @pekkaklarck on 26 Aug 2008

We have several 'Run Keyword' keywords ('Run Keyword', 'Run Keyword If',
'Wait Until Keyword Succeeds', ...) that execute other keywords internally.
All these keywords take the name and arguments of the actual keyword to
execute as last arguments, and most take some other arguments before them.
Currently all these arguments are resolved (i.e. variables in them
converted to their real values) when the top level 'Run Keyword' variant is
called.

The current approach of resolving all the arguments early has two major
problems.

  1. Arguments to actual executed keywords are shown in the log file in
    resolved format. This easily makes log files really big if keywords are
    used with variables that contain big values. This has caused real life
    problems with output files growing so big that they can't be processed.
    This problem is really nasty since it doesn't have any easy workaround.

  2. With 'Run Keyword If' and 'Run Keyword Unless', arguments are resolved
    even if they would never be used. See the discussion in issue Too earlier evaluate the keyword's arguments of Run keywork if  #62 for more
    information. This problem has workarounds, but it's still an inconvenience.

To make things more complicated, some external libraries use build-in 'Run
Keyword' variants internally. We should make it possible that those
keywords could also defer argument resolving but they should also keep
working unmodified.

We have a pretty good idea how to solve the problem. It's very much in line
with the solution proposed in issue #62, but we need handle all 'Run
Keyword' variants (and they have different number of args that must be
resolved) also need to add a possibility for external keywords to somehow
register themselves so that also they are handled correctly. The fix will
be latest in 2.1, but we also have 2.0.2 before that.

Activity

  1. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 29 Aug 2008

    Started with this issue. The fix proposed in issue 62 is not working in all cases so
    there was need to find other solution for this problem. More details later when this
    new solution is tested properly.

  2. added this to the 2.0.2 milestone on Jun 29, 2014
  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 29 Aug 2008

    This starts to be done. See r552 for the code changes and r553 and r554 for test
    changes. See the documentation from the end of libraries/BuiltIn.py.

    Documentation needs to be reviewed and all tests needs to be executed with Jython.
    After that, this task should be done.

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 1 Sep 2008

    Fix seems to work well in our own tests. Still TODO:

    1. Wait for results on using the fixed version in an internal project.
    2. Comment to BuiltIn.RunKeyword helper library that if these kws are used internally
      by keywords from other libraries, those kws should register themselves.
    3. Proofreading docs for registering method.

    This is such a special case that there's no need to add any documentation to user guide.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 3 Sep 2008

    Otherwise done, but we just realized that there can be problems if all the args to
    the keyword are given with a list variable containing something that should be
    escaped. Need to create a test for this case, and if there really is problem it must
    obviously be fixed too.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 5 Sep 2008

    Fixed the situation described in previous comment in r603 and comment to that
    modification is fixed in r616.

    Now keywords register as run keyword variant get the registered number of arguments
    resolved and other arguments evaluation is postponed.

    In case @⁠{list} variable contains also the first arguments, it needs to be unpacked
    and the arguments going over the registered count of arguments needs to be escaped as
    those will be unescaped later.

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 9 Sep 2008

    There is still some special cases that needs to be taken into account. In case there
    are multiple list variables given and the first one does not provide needed amount of
    arguments, the keyword execution fails.

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 10 Sep 2008

    One of the new test for Set Variable If (builtin/set_variable_if.html) fails due to
    the newly found problem (that test actually found the problem in the first place).
    This test is not enough the test the underlying problem fully, but it should
    obviously pass after the issue is fixed.

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 11 Sep 2008

    Finally this should be ready. See r676 for code changes and r677 for added tests.

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions