Skip to content

Issue/4609 - #4760

Merged
pekkaklarck merged 11 commits into
robotframework:masterfrom
ursa-h:issue/4609
May 17, 2023
Merged

pekkaklarck merged 11 commits into
robotframework:masterfrom
ursa-h:issue/4609

Conversation

@ursa-h

@ursa-h ursa-h commented May 10, 2023 •

Copy link
Copy Markdown
Contributor

Allow Set Library Search Order to override the local keywords precedence.

Restore ability to better control the prioritized keywords through Library Search Order

  • Prioritize search order even when there is another keyword that is
    • a better match
    • local
    • private

Enables simpler unit testing of keywords

@pekkaklarck

Copy link
Copy Markdown
Member

Is there some reason for this PR to be Draft? On a quick look it looks pretty good. Very nice work updating tests. Few comments about it anyway:

  • New tests should be added for a situation where there are multiple matches after applying the search order. That can happen at least if there are multiple keywords having embedded arguments that match the used keyword in the preferred resource/library. Tests should be organized so that one of the keywords matches better than others. If there already are tests like this and I missed them, let me know.
  • New tests should be added for a situation where there's an unresolvable conflict after applying the search order.
  • Do you remember is there documentation somewhat that should be updated?
  • Some of the edited files don't have newline at the end. Please add them to make the diff (and future diffs if there are new edits) cleaner.

RF 6.1 is already pretty massively late and we try to get it released ASAP. It would be nice to get this into that release, because otherwise it needs to wait until RF 6.2 or RF 7.0, whichever comes first. I hope we'd be close to the release candidate after the next week. Ping me on Slack if you have problems hitting that deadline.

@ursa-h
ursa-h marked this pull request as ready for review May 15, 2023 06:55
@ursa-h

ursa-h commented May 16, 2023 •

Copy link
Copy Markdown
Contributor Author

Thank you for the valuable comments @pekkaklarck

4 tests added:
Best Search Order Controlled Match Wins In Resource
Best Search Order Controlled Match Wins In Library
Search order causes conflict within resource
Search order causes conflict within library

In documentation I changed only one sentence. I wonder if I missed something. All looked like it describes how it now works.

they are given precedence over other keywords. If there are still conflicts
after looking for best matches, Robot Framework checks can they be
resolved based on the `library search order`_.
they are given precedence over other keywords. Alternatively, `library search order`_

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link does not seem to work. Could be replaced with :name:Set Library Search Order from the BuiltIn_ library

@pekkaklarck

Copy link
Copy Markdown
Member

Looks great! I enabled running tests and I'll merge this if they pass.

There are some whitespace issues with tests (missing newlines, tabs instead of spaces), but I can fix them myself. I'll also check the issue with link.

@pekkaklarck

Copy link
Copy Markdown
Member

The link in documentation worked fine. Notice that you need to generate the User Guide using the doc/userguide/ug2html.py script to see how changes actually look like. I already fixed whitespace issues locally.

pekkaklarck added a commit that referenced this pull request May 23, 2023
- Tabs to spaces
- Make sure files end with a newline

The PR was otherwise great!
@ursa-h
ursa-h deleted the issue/4609 branch May 30, 2023 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants