rfswarm-agent can't find any resource files when using version 1.2.0
Describe the bug When using rfswarm-manager and rfswarm-agent in the 1.2.0 version results in errors trying to lookup resource files
To Reproduce Steps to reproduce the behavior:
- Start a test that imports User-keyword resource files (either in Settings or using "Import Resource" in the test)
Actual Results 20240102 10:56:10.886 | ERROR | Error in file '/tmp/rfswarmagent/scripts/api_system_load.robot' on line 5: Variable file '/tmp/rfswarmagent/scripts/resources/env_vars.py' does not exist. 20240102 10:56:10.886 | ERROR | Error in file '/tmp/rfswarmagent/scripts/api_system_load.robot' on line 6: Resource file '/tmp/rfswarmagent/scripts/resources/api/keywords/helpers/asset_config_helpers.robot' does not exist.
Expected behavior Test should run and be able to find the resource files it needs to run the test
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Ubuntu
- Browser n/a
- Version: 22.04
Mobile phone (please complete the following information):
- Device: n/a
- OS: n/a
- Browser n/a
- Version n/a
Additional context Removing version 1.2.0 and re-installing version 1.1.5 allows the test to run and find all resource files without any issues.
Thanks for the bug report, It's odd because none of the changes in 1.2.0 were related to the copying of resource files.
To help narrow down the problem can you check if the following combinations work:
- Manager version 1.1.5 & agent version 1.2.0
- Manager version 1.2.0 & agent version 1.1.5
Also can you show the api_system_load.robot file (or the just setting section)
Hopefully I can find a way to reproduce this.
Sorry, I thought I had added this already
*** Settings *** Library Collections Library DateTime Library OperatingSystem Variables ${EXECDIR}/resources/env_vars.py Resource ${EXECDIR}/resources/api/keywords/helpers/asset_config_helpers.robot Resource ${EXECDIR}/resources/api/keywords/helpers/conduit_requests.robot Resource ${EXECDIR}/resources/api/keywords/helpers/registration_helpers.robot Resource ${EXECDIR}/resources/api/keywords/helpers/setup_teardown/suite_helpers.robot Resource ${EXECDIR}/resources/api/keywords/verifications/registration_verifications.robot Resource ${EXECDIR}/resources/api/keywords/helpers/test_asset_helper.robot
Nothing special with any of the libraries, but the issue appears to be more around the manager getting those to the agent.
For you question from above: Manager version 1.1.5 & agent version 1.2.0 - tests work and run without issue Manager version 1.2.0 & agent version 1.1.5 - test fail and have the errors reported above Manager version 1.2.0 & agent version 1.2.0 - tests fail with above errors
From the results here, the culprit appears to be the manager code but you had noted that nothing in the latest changes for the manager were involving resource pointers. Not ruling out that I could be doing something wrong here, but if I am then I certainly can't see how I got myself into this situation 😄
From your tests it certainly looks like the Manager is at fault, will investigate and update here what I find, Thanks for letting me know :+1:
When I dig into the code that deals with the RF variables (function is replace_rf_path_variables)
I see the comment
# ${EXECDIR}
# not sure how to handle this for now
I realised it's never handled ${EXECDIR} as I remember now writing that comment when I wrote that function, so now I'm puzzled how that worked for you in 1.1.5? Are you sure you didn't previously use {CURDIR}?
That line in 1.2.0 -> https://github.com/damies13/rfswarm/blob/1921386410c32926e342f18000d48b623e1935ad/rfswarm_manager/rfswarm.py#L1260 That line in 1.1.5 -> https://github.com/damies13/rfswarm/blob/e2059d283acaa4097063418e08d09f6cf2f2b23f/rfswarm_manager/rfswarm.py#L1254
As you can see no change
FYI The problem I faced with this variable is knowing what to evaluate it to as Operating-system variables says:
${EXECDIR} An absolute path to the directory where test execution was started from.
As the manager doesn't execute the robot script, there wasn't a clear answer as to what {EXECDIR} should be resolved to, my initial thought was the same as {CURDIR} as that would be the most common answer, but that is not always the case so rather than making an incorrect guess I choose to leave it unresolved and you are the first to ask about this variable.
FYI if you run the manager in debug level 8, select your test and connect the agent (no need to run the test) search the debug output for pathin and pathout, you can see it being evaluated in that function
Hey everyone, I am still experiencing this issue on the latest rfswarm, is there a resolution to this issue?
Hi @mickaylab and welcome,
Can you give a bit more information?
Ideally if you can provide an example that demonstrates the issue this a lot.
but if not can you confirm are you using ${EXECDIR} or ${CURDIR}? (${EXECDIR} does not work with RFSwarm as mentioned above)
Also can you confirm which version you are using now and which version you were previously using, did you see a difference in behavior between them?
In version 1.3.0 I fixed a couple of bugs we found related to ${CURDIR}, but I'd like to know if there are more we haven't found.
Dave.
This might be related to Issue #246, If so, hopefully v1.3.1 will resolve it
Can you confirm if this remains an issue with v1.3.2?
1.3.1 and v1.3.2 have many bug fixes related to resource files