Smoke tests framework for Django Web Framework
Project description
[![Build Status](https://travis-ci.org/djentlemen/django-smoked.svg)](https://travis-ci.org/djentlemen/django-smoked)
[![Coverage Status](https://coveralls.io/repos/djentlemen/django-smoked/badge.svg?branch=master)](https://coveralls.io/r/djentlemen/django-smoked?branch=master)
# django-smoked
Smoke tests framework for Django Web Framework
## Motivation
> Code without tests is broken by design. - Jacob Kaplan-Moss, Django core developer
Every successful deployment of an application must be followed by series of tests to ensure that website is up and works.
Compared to unit/integration/functional/performance/etc tests which runs in an isolated environment, smoke tests are designed to check safely the production environment. These tests only check the fundemantal functionality, ex. email sending is working, app is able to connect to the database, background queue accepts task, etc.
## Idea
Create framework for **reusable** smoke tests which could be easily shared among projects.
Each test is defined by a name and an action to be taken:
```python
class DatabaseTest(SmokeTest):
name = 'Database test'
description = 'Check all database connection are valid'
def test(self):
...
```
Smoke tests are registered manually in custom module:
```python
# settings.py
SMOKE_TESTS = 'myproject.smoked'
```
```python
# myproject/smoked.py
import smoked
# Built-in test
smoked.register('smoked.DatabaseTest')
# Custom test
smoked.register('myproject.MessageQueueTest')
# ad-hoc function
def smoke_test():
...
smoked.register(smoke_test, name='Test my setup', description='...')
# ad-hoc function using decorator
@smoked.register(name='Verbose name', description='Long text')
def smoke_test():
...
# default name and description
@smoked.register
def smoke_test(): # name='smoke_test'
""" Docstring will become description """
...
```
Test runner is trigger either by management command:
```shell
./manage.py smoked
```
or an API call:
```shell
curl -d"TOKEN=VerySecretToken" http://myproject.io/_smoked/
```
## Licence
MIT
[![Coverage Status](https://coveralls.io/repos/djentlemen/django-smoked/badge.svg?branch=master)](https://coveralls.io/r/djentlemen/django-smoked?branch=master)
# django-smoked
Smoke tests framework for Django Web Framework
## Motivation
> Code without tests is broken by design. - Jacob Kaplan-Moss, Django core developer
Every successful deployment of an application must be followed by series of tests to ensure that website is up and works.
Compared to unit/integration/functional/performance/etc tests which runs in an isolated environment, smoke tests are designed to check safely the production environment. These tests only check the fundemantal functionality, ex. email sending is working, app is able to connect to the database, background queue accepts task, etc.
## Idea
Create framework for **reusable** smoke tests which could be easily shared among projects.
Each test is defined by a name and an action to be taken:
```python
class DatabaseTest(SmokeTest):
name = 'Database test'
description = 'Check all database connection are valid'
def test(self):
...
```
Smoke tests are registered manually in custom module:
```python
# settings.py
SMOKE_TESTS = 'myproject.smoked'
```
```python
# myproject/smoked.py
import smoked
# Built-in test
smoked.register('smoked.DatabaseTest')
# Custom test
smoked.register('myproject.MessageQueueTest')
# ad-hoc function
def smoke_test():
...
smoked.register(smoke_test, name='Test my setup', description='...')
# ad-hoc function using decorator
@smoked.register(name='Verbose name', description='Long text')
def smoke_test():
...
# default name and description
@smoked.register
def smoke_test(): # name='smoke_test'
""" Docstring will become description """
...
```
Test runner is trigger either by management command:
```shell
./manage.py smoked
```
or an API call:
```shell
curl -d"TOKEN=VerySecretToken" http://myproject.io/_smoked/
```
## Licence
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-smoked-0.1a.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for django_smoked-0.1a-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61644e87a499472e0227e94450a74e26e1f81aa890b6032c17ea3f6a0e25a295 |
|
MD5 | 7fd4ab49a825efaa36ca387f5ed32059 |
|
BLAKE2b-256 | b554fb24347e459d51f72e2e2b14ff2de966edd78efd507f559b6d16515a8efe |