Comments (4)
Thanks for the fix, it did the trick!
And I agree with your argument here, the LSP devs got this one wrong.
from robotframework-docker.
Found the stack trace in the output panel!
Traceback (most recent call last):
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\DockerComposeLibrary.py", line 60, in __init__
self._project_name = re.sub(r'\W', '_', BuiltIn().get_variable_value('${SUITE NAME}'), re.ASCII).lower()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\robot\libraries\BuiltIn.py", line 1502, in get_variable_value
name = self._get_var_name(name, require_assign=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\robot\libraries\BuiltIn.py", line 1780, in _get_var_name
replaced = self._variables.replace_string(original)
^^^^^^^^^^^^^^^
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\robot\libraries\BuiltIn.py", line 71, in _variables
return self._namespace.variables
^^^^^^^^^^^^^^^
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\robot\libraries\BuiltIn.py", line 67, in _namespace
return self._get_context().namespace
^^^^^^^^^^^^^^^^^^^
File "C:\code\rob2\.micromamba\envs\robot\Lib\site-packages\robot\libraries\BuiltIn.py", line 62, in _get_context
raise RobotNotRunningError('Cannot access execution context')
robot.libraries.BuiltIn.RobotNotRunningError: Cannot access execution context
from robotframework-docker.
Here's an old issue in the LSP repo discussing the same problem for a different library: robocorp/robotframework-lsp#166
from robotframework-docker.
As I see it, LSP tries to get access to the library instance (for introspection?), but assumes the library would not initialise itself before being used or doesn't depend on Robotframework during initialisation.
As initialising a library in __init__
seems to be the official correct way to do it in Robotframework, this assumption is wrong. That's why they suggest to defer initialisation in the library.
As this is not that big of an issue with this library, I fixed it by catching the RobotNotRunningError
. But overall I think it's more of an issue of LPS making incorrect presumptions about the library lifecycle.
Could you give this a try in version 1.4.2
?
from robotframework-docker.
Related Issues (20)
- Consider adding additional docker-compose commands HOT 1
- Various docker compose commands don't work if suite name has uppercase letters. HOT 1
- Consider adding ability to run keywords on remote machine
- Test library with Robotframework 5 and upgrade if needed
- Add flag to Docker Compose Up keyword to wait for containers to start and become healthy
- Project files should be considered relative to suite directory
- Multiple 'unrecognized option' errors when checking sources with pylint
- Exception 'IndexError: list index out of range' when trying to get exposed port for service
- Lots of "Useless option value for '--disable'" during pylint stage
- User Docker Compose V2 by default
- Add support for 'docker compose version'
- Add support for 'docker compose kill'
- Add support for 'docker compose start/stop/restart'
- Add support for 'docker compose pause/unpause'
- Get Exposed Service keyword does not provide error reason in case of failure
- Docker Compose Up appends --wait flag to docker-compose even when using Docker Compose V1
- PyLint warning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated
- GetExposedPort can fail with "Failed to query" error even if service/container exists
- Consider updating dependencies to allow robotframevork v7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotframework-docker.