Giter Club home page Giter Club logo

robotframework-docker's Introduction

image

image

image

RobotFramework Docker

Short Description

Robot Framework library for working with docker and docker-compose.

Installation

Installation using pip

pip3 install robotframework-docker

Installation from sources

python3 setup.py install

Example

*** Settings ***
Documentation           DockerComposeLibrary tests.
Library                 DockerComposeLibrary
Library                 RequestsLibrary
Test Setup              Docker Compose Up
Test Teardown           Docker Compose Down


*** Test Cases ***
Start Apache Web Server
    ${service} =        Get Exposed Service  httpd  80
    Log To Console      http has started and is available at http://${service.host}:${service.port}

License

Apache License 2.0

robotframework-docker's People

Contributors

mentalisttraceur avatar vogoltsov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

takeda

robotframework-docker's Issues

Support Robot LSP inspection

When trying to use your library, I get this error in vscode on the Library DockerComposeLibrary line:

Unresolved library: DockerComposeLibrary.
Error generating libspec:
Initializing library 'DockerComposeLibrary' with no arguments failed: RobotNotRunningError: Cannot access execution context robotframework

Consequently, all the Docker keywords also get red squiggles and show as undefined in the tooltip.

I'm using this extension: https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp

The library works fine when running my test case with Robot Framework, btw. So most likely you just need to refactor some initialization code to only run the first time a keyword is invoked, or just do something differently so as not to depend on the execution context.

Lots of "Useless option value for '--disable'" during pylint stage

pylintrc:1:0: E0015: Unrecognized option found: no-space-check (unrecognized-option)
pylintrc:1:0: R0022: Useless option value for '--disable', 'print-statement' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4[9](https://github.com/vogoltsov/robotframework-docker/actions/runs/3360902173/jobs/5570644455#step:6:10)42. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'parameter-unpacking' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'unpacking-in-except' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'old-raise-syntax' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'backtick' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'import-star-module-level' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'apply-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'basestring-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'buffer-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'cmp-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'coerce-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'execfile-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'file-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'long-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'raw_input-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'reduce-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'standarderror-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'unicode-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'xrange-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'coerce-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'delslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'getslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'setslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'no-absolute-import' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'old-division' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'dict-iter-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'dict-view-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'next-method-called' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'metaclass-assignment' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'indexing-exception' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'raising-string' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'reload-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'oct-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'hex-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'nonzero-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'cmp-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'input-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'round-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'intern-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'unichr-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'map-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'zip-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'range-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'filter-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'using-cmp-argument' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'div-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'idiv-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'rdiv-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'exception-message-attribute' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'invalid-str-codec' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'sys-max-int' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'bad-python3-import' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-string-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-str-translate-call' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-itertools-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-types-field' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'next-method-defined' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'dict-items-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'dict-keys-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'dict-values-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-operator-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-urllib-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'xreadlines-attribute' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'deprecated-sys-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'exception-escape' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: R0022: Useless option value for '--disable', 'comprehension-escape' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
pylintrc:1:0: W00[12](https://github.com/vogoltsov/robotframework-docker/actions/runs/3360902173/jobs/5570644455#step:6:13): Unknown option value for '--disable', expected a valid pylint message and got 'long-suffix' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'old-ne-operator' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'old-octal-literal' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'non-ascii-bytes-literal' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'invalid-unicode-literal' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'locally-enabled' (unknown-option-value)
pylintrc:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'eq-without-hash' (unknown-option-value)

GetExposedPort can fail with "Failed to query" error even if service/container exists

Possibly, the docker compose port command has been modified to return error code in case port is not exposed.

As there is no need to differentiate between "service does not exist", "service is not started" and "service is started, but port is not exposed", I've decided to return the same error in all cases when exposed port cannot be obtained.

Various docker compose commands don't work if suite name has uppercase letters.

Hey,

I've noticed that, when my suite name contains uppercase letters, the docker compose logs keywords returns an empty string.
When I manually overwrite the project_name parameter of the library or add a .lower() on the get_variable_value('${SUITE NAME}'), everything works again.

Discovered because I noticed by that the names of the containers are all lowercase when manually running docker ps.

Kind regards,
Dries

Consider adding additional docker-compose commands

Hi,

Would you consider additional support for the following docker-compose commands:

  • start
  • stop
  • restart
  • pause
  • unpause
  • kill
  • etc. ;-)

I'm using the library for system tests where a docker-compose file is used for the test deployment and it would be very useful to be able to manipulate the test deployment in order to stop/start or kill or pause/unpause specific services to validate the behaviour of the target services under these kind of failure scenarios.

Thanks for consideration. Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.