An automated traffic light/signal/semaphore GUI showing the state during test driven development (TDD), mainly written for coding dojos.
Project description
What does it do?
Runs a test command when some file is created/modified/deleted, showing the return value in a GUI.
There are 3 states:
Red: Last test job failed/errored (it didn’t return zero)
Yellow: Running a test job
Green: Last test job passed (it returned zero)
The test command output is shown in the console standard output whereby Dose was called. The same applies to the standard error, but it’s red-colored. Dose uses ANSI escaping codes for coloring text in a terminal.
Syntax / Example
Just call dose TEST_COMMAND, where TEST_COMMAND is what you would call to run some test suite. Dose is written in Python 2 but the test command can be anything.
Hint (color): The ANSI coloring from the test command is to the underlying console. For example, a tox + py.test Python project whose tox.ini has commands = py.test {posargs}, you can force the py.test coloring with dose tox -- --color=yes.
Hint (shell): You can use shell pipes in your test command by quoting the whole command, e.g. dose "cat tests.txt | verify.sh".
What does it watch?
Using the watchdog package, Dose recursively watches a working directory for file creation/modification/deletion events.
The watched directory is the current working directory, the one whereby Dose was called. You can change it with the GUI, but remember that the test command is always called in that directory too.
You can also configure an ignore pattern to avoid undesired detections on temporary/compiled files.
Valid events during a test would kill (SIGTERM) a test job to restart it. There’s a 10ms delay before starting a test job and a 50ms delay before killing it. Multiple events are joined to avoid spawning/killing more than required.
There’s a cycle/repeat detection in the watcher: repeating an event won’t kill the test job. Modifying the same file twice will have the second modification ignored, unless it happens after finishing a test job.
Hint (change directory): You can watch a directory and call a command in another directory by using cd PATH && TEST_COMMAND as your test command, e.g. dose "cd toxinidir && tox".
Requirements
wxPython 2.8 or 3.0 (classic)
watchdog
You should install the wxpython or wxgtk packages from your Linux distribution, or get the Windows / Mac OS X binary packages directly from the wxPython official site. On Mac OS X 10.11 (El Capitan), this blog post might help.
Installation
pip install dose
GUI Controls
Dragging: Move
Dragging holding Ctrl/⌘: Resize
Dragging holding Shift: Controls th transparency
Double click: start or stop the watcher (can kill the test job)
A right click (or Ctrl + click on OSX) show more options.
Please see the CHANGES.rst file for more information.
Copyright (C) 2012-2016 Danilo de Jesus da Silva Bellini
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file dose-1.1.1.zip
.
File metadata
- Download URL: dose-1.1.1.zip
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8967bd94ad464d5f055ce3732e3a802cd5d69246aac7d8d7375b42927b807113 |
|
MD5 | 6d94f3a291426e473a91fbf3ffff2b85 |
|
BLAKE2b-256 | 34428ece541e6734bb30b6a5dc619d3722b8e78866b0b2f4f02b9a8808edf763 |
File details
Details for the file dose-1.1.1.tar.gz
.
File metadata
- Download URL: dose-1.1.1.tar.gz
- Upload date:
- Size: 33.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 852de030d7f8baf9542c4661c4d88692eeeb9687e694337e812e4d9bfee6d7f3 |
|
MD5 | a86300f00a3679d4a0f7e657cc6dad3f |
|
BLAKE2b-256 | ae339eccc06906745f6a425189727819e2b1bd04fd1908bee23f181743f0bbb8 |
File details
Details for the file dose-1.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: dose-1.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544c6f0c0474c16d9c64e316f0b6d96741328370b102a1a8c62fa2e4fb8494c5 |
|
MD5 | 326d7202d99c373a3d44cb60a4b43c1d |
|
BLAKE2b-256 | 39a68cc89a4a994c88787ae68084029727d4c804412ad70f914cec5c79fd1721 |