Skip to content

Commit d381404

Browse files
committed
Update README.
- Better introduction. - Installation instructions. - Starting. - Configuring. Includes configuring port_file which fixes #3. - Stopping. Still want to include a full scale example.
1 parent 1aacd27 commit d381404

File tree

1 file changed

+80
-49
lines changed

1 file changed

+80
-49
lines changed

README.rst

Lines changed: 80 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,100 @@
1-
Robot Framework Python Remote Server
2-
====================================
3-
4-
Remote server for `Robot Framework`_ implemented with Python.
1+
Python Remote Server for Robot Framework
2+
========================================
53

64
Introduction
75
------------
86

9-
`Robot Framework`_ is a generic test automation framework implemented
10-
with Python_ that also runs on Jython_ (JVM) and IronPython_
11-
(.NET). Its testing capabilities can be easily extended with generic
12-
and custom test libraries implemented using Python and also Java when
13-
using Jython. It also has a `remote library interface`_ that allows
14-
using test libraries implemented using other languages or running on
15-
different machines.
7+
`Robot Framework`_ remote servers allow hosting test libraries on different
8+
processes or machines than Robot Framework itself is running on. This version
9+
is implemented in Python_ and supports also Jython_ (JVM) and
10+
IronPython_ (.NET). See `remote library interface documentation`_ for more
11+
information about the remote interface in general as well as for a list of
12+
remote server implementations in other programming languages.
1613

17-
The `remote library architecture`_ consists of `Remote` test library
18-
that is part of normal Robot Framework installation and separate
19-
language specific remote servers. This project contains Python_
20-
implementation of the remote server.
14+
This project is hosted in GitHub_ and downloads are available in PyPI_.
2115

22-
.. _Robot Framework: http://robotframework.org>
16+
.. _Robot Framework: http://robotframework.org
2317
.. _Python: http://python.org
2418
.. _Jython: http://jython.org
25-
.. _IronPython: TODO
26-
.. _remote library interface:
27-
.. _remote library architecture: TODO
19+
.. _IronPython: http://ironpython.codeplex.com
20+
.. _remote library interface documentation: http://code.google.com/p/robotframework/wiki/RemoteLibrary
21+
.. _GitHub: https://github.com/robotframework/PythonRemoteServer
22+
.. _PyPI: http://pypi.python.org/pypi/robotremoteserver
23+
24+
Installation
25+
------------
26+
27+
The easiest installation approach is using `pip`_:
28+
29+
.. sourcecode:: bash
30+
31+
$ pip install robotremoteserver
32+
33+
Alternatively you can download the `source distributions`_, extract it, and
34+
install it using:
35+
36+
.. sourcecode:: bash
37+
38+
$ python setup.py install
39+
40+
.. _`pip`: http://www.pip-installer.org
41+
.. _`source distributions`: PyPI_
42+
43+
Usage
44+
-----
45+
46+
Starting
47+
~~~~~~~~
48+
49+
The remote server can be started by simply creating an instance of the server
50+
and passing a test library instance or module to it:
51+
52+
.. sourcecode:: python
53+
54+
from robotremoteserver import RobotRemoteServer
55+
from mylibrary import MyLibrary
56+
57+
RobotRemoteServer(MyLibrary())
2858

59+
By default the server listens to address 127.0.0.1 and port 8270. See the next
60+
section for information how to configure them.
2961

30-
*CONTENT BELOW (AND ALSO ABOVE) WORK-IN-PROGRESS*
62+
Configuration
63+
~~~~~~~~~~~~~
3164

32-
Examples Using Remote Servers
33-
-----------------------------
65+
The remote server accepts following configuration parameters:
3466

35-
Examples on how test libraries can use the remote servers can be found from
36-
`example` directory. These example libraries can be started with commands::
67+
============== ================ ========================================
68+
Argument Default Explanation
69+
============== ================ ========================================
70+
``host`` ``'127.0.0.1'`` Address to listen. Use ``'0.0.0.0'`` to listen to all available interfaces.
71+
``port`` ``8270`` Port to listen. Use ``0`` to select free port automatically.
72+
``port_file`` ``None`` File to write port that is used.
73+
``allow_stop`` ``True`` Allow/disallow stopping the server using ``Stop Remote Server`` keyword.
74+
============== ================ ========================================
3775

38-
python example/examplelibrary.py
39-
jython example/examplelibrary.py
40-
ruby example/examplelibrary.rb
76+
Address and port that are used are printed to the console where the server is
77+
started. Writing port to a file by using ``port_file`` argument is especially
78+
useful when the server selects a free port automatically. Other tools can then
79+
easily read the active port from the file. If the file is removed prior to
80+
starting the server, tools can also wait until the file exists to know that
81+
the server is up and running.
4182

42-
Note that all the above commands require that language's module search
43-
path is set so that the respective remote server module can be imported.
44-
By default the servers listen to connections to localhost on port 8270,
45-
but this can be configured like::
83+
Example:
4684

47-
python example/examplelibrary.py localhost 7777
48-
ruby example/examplelibrary.rb 192.168.0.1 8270
85+
.. sourcecode:: python
4986

50-
These examples will start the remote server so that it provides
51-
keywords implemented in the example module. After the remote server is
52-
started, an example test case file can be executed using the familiar
53-
`pybot` or `jybot` commands, possibly giving the port where the server
54-
is listening as a variable::
87+
from robotremoteserver import RobotRemoteServer
88+
from mylibrary import MyLibrary
5589

56-
pybot example/remote_tests.html
57-
jybot example/remote_tests.html
58-
pybot --variable PORT:7777 example/remote_tests.html
90+
RobotRemoteServer(MyLibrary(), host='10.0.0.42', port=0,
91+
port_file='/tmp/remote-port.txt', allow_stop=False)
5992

60-
The results should be the same regardless of the example library or start-up
61-
script used.
93+
Stopping
94+
~~~~~~~~
6295

63-
Testing Remote Servers
64-
----------------------
96+
The remote server can be gracefully stopped using three different methods:
6597

66-
Tests for the remote servers are inside `test` directory. Acceptance tests
67-
can be executed using `tests/run.py` script and running the script without
68-
arguments provides more information. Notice that tests are not included in
69-
source distributions.
98+
- Hitting ``Ctrl-C`` on the console where the server is running.
99+
- Sending the process ``SIGINT``, ``SIGTERM``, or ``SIGHUP`` signal.
100+
- Using ``Stop Remote Server`` keyword (unless explicitly disabled).

0 commit comments

Comments
 (0)