Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Library Search Order doesn't work if there are two matches and one is from standard libraries #4516

Closed
jaasal opened this issue Oct 26, 2022 · 4 comments

Comments

@jaasal
Copy link

jaasal commented Oct 26, 2022

Versions: Robot Framework 6.0, Python 3.8.10, Windows 10
Prerequisites: robotframework-sshlibrary installed

Execute the following test:

*** Settings ***
Library  SSHLibrary
Library  OperatingSystem

*** Test Cases ***
Test Library Search Order
  Set Library Search Order  OperatingSystem  SSHLibrary  
  Get File  ./foo.txt

Expected: Get File -keyword from OperatingSystem is executed
Actual: Warning about duplicate keywords is shown, Get File -keyword from SSHLibrary is executed

@jaasal jaasal changed the title Set Library Oder -keyword does not affect library order Set Library Search Order -keyword does not affect library order Oct 26, 2022
@pekkaklarck
Copy link
Member

Did this work before RF 6.0?

@jaasal
Copy link
Author

jaasal commented Oct 26, 2022

Did this work before RF 6.0?

Yes, we updated from 5.0 and there it did work.

@pekkaklarck
Copy link
Member

pekkaklarck commented Oct 26, 2022

Ok. I think I know what caused that. Needs to be fixed in 6.0.1.

@pekkaklarck pekkaklarck added this to the v6.0.1 milestone Oct 26, 2022
@pekkaklarck pekkaklarck changed the title Set Library Search Order -keyword does not affect library order Set Library Search Order doesn't work if there are two matches and one is from standard libraries Oct 27, 2022
@pekkaklarck
Copy link
Member

pekkaklarck commented Oct 27, 2022

This regression occurs if there are two matches and one of them are from a standard library. In such cases we in general give precedence to the other keyword, but the search order should be used first and in this case it would resolve the conflict. Although Set Library Search Order isn't totally broken, this is definitely a high priority regression.

This was most likely broken when related code was enhanced as part of #4454. It's a stupid logic bug that's easy to fix. Somewhat surprising we didn't have any tests for this scenario.

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

No branches or pull requests

2 participants