Skip to content

Commit c6dfbec

Browse files
committed
Merge branch 'release/2.8.0'
2 parents b32836d + 4b5a223 commit c6dfbec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1197
-142
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*/node_modules/*
55
*/bower_components/*
66
webapp/tmp/*
7+
/docs

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Version 2.8.0
4+
5+
* Favicon now displays an error/success icon for sessions and tests
6+
* Initial support for parallel runs
7+
* Add option to configure auxiliary services for supporting custom APIs
8+
* Added documentation for installation, deployment and configuration (See https://backslash.readthedocs.org)
9+
* *NOTE*: It is recommended to run Slash 1.2.4 or above with this release, to avoid a bug involving test counts and interactive sessions
10+
311
## Version 2.7.0
412

513
* You can now search for sessions by contained test name via the `test = my_test_name` search clause

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ testserver:
1010
python manage.py testserver
1111

1212
clean:
13-
rm -rf .env .ansible-env webapp/tmp/ webapp/node_modules/ webapp/bower_components/ static
13+
rm -rf .env webapp/tmp/ webapp/node_modules/ webapp/bower_components/ static
1414
find . -name "*.pyc" -delete
1515

1616
test:

Vagrantfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

_lib/ansible.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

_lib/slash_running.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ class _Plugin(BackslashPlugin):
2727
def _get_initial_session_metadata(self):
2828
returned = super()._get_initial_session_metadata()
2929
returned.update({"users": {
30-
"builtin_users": [
31-
{"id":-1, "name": "infinidat", "role": "INFINIDAT", "email": "[email protected]", "password": "123456"},
32-
{"id":-2, "name": "admin", "role": "ADMIN", "email": "[email protected]", "password": "123456"},
33-
{"id":-3, "name": "technician", "role": "TECHNICIAN", "email": "[email protected]", "password": "123456"},
34-
{"id":-4, "name": "tablet", "role": "READ_ONLY", "email": "[email protected]", "password": "123456"},
30+
"some_data": [
31+
{'bla': '2', 'j': 3},
3532
]
3633
}})
3734
return returned

deps/app.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Flask-Login>=0.3.0,<0.4.0
1010
Flask-Security>=1.7.5
1111
Flask-Simple-API>=1.4.0
1212
Flask-Migrate>=1.3.0
13-
Flask-SQLAlchemy
13+
Flask-SQLAlchemy>=2.2
1414
sqlalchemy>=1.1.0
1515
munch
1616
pyparsing

docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ services:
1919
depends_on:
2020
- db
2121
- redis
22+
logging:
23+
driver: syslog
2224

2325
db:
2426
image: "postgres:9.6"

docs/_static/backslash-logo.png

2.99 KB
Loading

docs/client_configuration.rst

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
Client Configuration
2+
====================
3+
4+
Once your server is all set up, you can start reporting test executions to it.
5+
6+
Backslash is a generic test reporting service that is not tightly
7+
coupled to a specific use case, but the best out-of-the-box client
8+
support is for the Slash testing framework, as the two were developed
9+
in parallel.
10+
11+
This chapter will focus on how to get started reporting to Backslash
12+
from Slash, but it should be fairly easy to add integrations to other
13+
frameworks. We will be using the `official client library for
14+
Backslash <https://pypi.python.org/pypi/backslash/>`_, which also
15+
includes a supplemental plugin for Slash.
16+
17+
18+
Quick Configuration
19+
-------------------
20+
21+
The simplest configuration is to add the following to your
22+
``.slashrc`` in your project's root directory:
23+
24+
.. code-block:: python
25+
26+
import slash.plugins
27+
from backslash.contrib.slash_plugin import BackslashPlugin
28+
29+
slash.plugins.manager.install(
30+
BackslashPlugin(
31+
'http://your.backslash.server',
32+
), activate=True)
33+
34+
That's it!
35+
36+
When you first run your tests, the plugin will initialize itself and
37+
open a browser window asking you to log in, so that it can fetch a run
38+
token for your sessions.
39+
40+
Run Tokens
41+
----------
42+
43+
In order for Backslash to identify you when running tests, a *run
44+
token* is used. This token is generated by the server and stored by the
45+
client in ``~/.config/backslash`` for future runs.
46+
47+
By default, as stated above, the Backslash plugin fetches this token
48+
using a multi-step authentication via a web browser. However, you can
49+
specify the run token explicitly when constructing the plugin:
50+
51+
.. code-block:: python
52+
53+
plugin = BackslashPlugin(..., runtoken='xxxxx...')
54+
55+
Adding Session Metadata
56+
-----------------------
57+
58+
One of the most frequent tasks when reporting test runs is reporting metadata about the session in question. Backslash supports arbitrary JSON metadata, and it can be easily added by overriding the ``_get_initial_session_metadata`` method:
59+
60+
61+
.. code-block:: python
62+
63+
64+
import slash.plugins
65+
from backslash.contrib.slash_plugin import BackslashPlugin as BackslashPluginBase
66+
67+
68+
class BackslashPlugin(BackslashPluginBase):
69+
70+
def _get_initial_session_metadata(self):
71+
returned = super()._get_initial_session_metadata()
72+
returned.update({
73+
'environment_type': my_environment_type
74+
})
75+
return returned
76+
77+
78+
slash.plugins.manager.install(
79+
BackslashPlugin(
80+
'http://your.backslash.server',
81+
), activate=True)
82+
83+
84+
85+
Adding Test Subjects
86+
--------------------
87+
88+
Backslash test sessions run on *test subjects*. You can control how your session records its subjects by overriding the ``_get_extra_session_start_kwargs`` method:
89+
90+
.. code-block:: python
91+
92+
...
93+
def _get_extra_session_start_kwargs(self):
94+
returned = super()._get_extra_session_start_kwargs()
95+
returned['subjects'] = [
96+
{
97+
'name': 'microwave1',
98+
'product': 'Microwave',
99+
'version': 'v1',
100+
'revision': '123456',
101+
}
102+
]
103+
return returned
104+
...

0 commit comments

Comments
 (0)