Abstract¶
The ePyUnit package provides extensions for the integrated Testautomation and Debugging of executables and scipts as subprocesses.
Technically ePyUnit provides extensions for the PyUnit and PyDev/Eclipse frameworks for blackbox tests and seamless integrated debugging of executables and scripts including nested calls of subprocesses. The standard frameworks, libraries and IDEs provide components as presented by the following figure.
. :
+----------------+ : +---------------------------+
| unittest | : | scripts and executables |
+---+------------+---+ : +---+-----------------------+---+
| automation | : | debugging |
+----------------+ : +---------------------------+
. :
These are extended by framework features for the seamless cross-process integration of scripts and programs.
.
+------------------------------+ +-----------------------------+
| automation and unittest | | seamless cross-process |
| for arbitrary | <---> | debugging |
| scripts and executables | | |
+------------------------------+ +-----------------------------+
|<--- seamless integration --->|
.
The included automation extension for the PyDev/Eclipse based debugging of - local and remote - Python subprocesses provides simplified support of detailed error analysis in case of test failures.
REMARK - Release¶
Current release seems to be quite good and stable on Linux, Windows too with a few required enhancements. Mac-OS may work too, wil be tested soon together with BSD and Solaris.
Blueprint¶
The ‘ePyUnit’ package provides a minimal but sufficient approach in particular for the low-effort test automation of scripts and tools suitable for operations of large scale application tests as well as for daily and advanced DevOps tasks.
- ePyUnit encapsulates processes and relies on PyUnit for commandline based unit and regression tests. The main focus is general blackbox testing of executables, for Python in addition the automation of PyDev debugging is included [details] .
- ePyUnit integrates into PyDev for the support of the graphical Eclipse IDE of unit testing and integrated graphical debugging, this is also supported for external processes started independently from the commandline [details] .
The ePyUnit components call the wrapped process and read the execution results from STDOUT, STDERR, and the exit value. The values are cached by Python variables either for further processing, or optional pass-through to the caller.
+-----------------------+ call +-----------------------+ | | ------> | | Unit tests for | epyunit | | Wrapped-Executable | Subprocess | | <----- | | +-----------------------+ stdin +-----------------------+ | stderr | | exit V | +-----------------------+ Cross-Process Debugging into PyDev Remote | | PyDevRDC | local and remote subprocesses Debug Server | +-----------------------+ by the PyDev Remote Debug Client | | . . . . . . . . | . . . . . . . . . . . . . . . . . . . | . . . . . . . . | | V V +-----------------------+ +-----------------------+ Python Units | PyUnit | <---> | PyDev | +-----------------------+ +-----------------------+ | | | V V / +-----------+ +-----------+ / IDE | CLI | | Eclipse |<--------------------/ +-----------+ +-----------+
The test components collect internally the data of multiple output sources and decide based on the selection of the user parameters whether the test was successful or has failed. Therefore a similar approach to Fuzzy-Logic is applied on mixed results consisting of partial failures and success.
The automation of the subprocess debug integration into the PyDev/Eclipse debugging framework provides for seamless debugging of cross-process unittest. For an integrated example refer to sequences of control flow [Design details], for the analysing logic and rules of test results refer to is provided by Test Syntax, Rules, and Correlation [details]. The provided scenarios are single level subprocesses
+----------------+ +------------+
| Python-Process | <--> | Subprocess |
+----------------+ +------------+
and nested multilevel scripts and executables as subprocesses
+----------------+ +------------+ +------------+
| Python-Process | <--> | Subprocess | <- ... --> | Subprocess |
+----------------+ +------------+ +------------+
Where each level of subprocesses could start an arbitrary number of local and remote subprocesses itself, and either correlate or pass-through the results.
The provided extension class ‘epyunit.unittest.subprocess.TestProcesss’ extends the standard class ‘unittest.case.TestCase’
. :
+------------------------------+ : +-----------------------------------+
standard unittest | | : | |
automation and alternative | Automation and Unittest | : | Debug |
debugging | unittest.case.TestCase | : | by PyDev - pdb |
| | : | |
+------------------------------+ : +-----------------------------------+
:
|<--- Eclipse / CLI --->| : |<--- Eclipse+PyDev / pdg --->|
.
by framework features for the integrated seamless unittest and debugging of scripts and programs as subprocesses.
.
+-----------------------------------------+ +-----------------------------------+
| | | |
integrated subprocess | Scripts and Programs | | seamless debug automation |
automation for | epyunit.unittest.subprocess.TestProcess | <---> | epyunit.debug.pydevrdc.PyDevRDC |
unittest with seamless | | | |
debugging +-----------------------------------------+ +-----------------------------------+
|<--- Eclipse / PyDev / PyUnit / CLI --->|
.
The provided package comprises functional atoms for various UseCases, as well as extension classes for the ‘unittest’ package to be used in combination with PyUnit and PyDev.
- Test Syntax, Rules, and Correlation
- Common call integration of subprocess units
- Integration into the Class Hierarchy of PyUnit
- Automation of Subprocess Debugging and Test-Integration by ‘pydevd.py’
For the implementation and architecture refer to
Application examples for ePyUnit see the multiplatform bash extensions:
Install¶
Supported Platforms:
The following platforms are in general fully supported, see remarks for some exceptions.
OS:
Linux: Fedora, CentOS, RHEL, Debian
Any other should work too! Try - same for generic by sources on all:
python setup.py install --user python setup.py install --user --offline python setup.py install --help-epyunit
Distribution: source, tar.gz, rpm
MS-Windows: Windows7
Bash is deactivated by default, document creation not yet supported, requires Linux and bash.
Distribution: source, tar.gz, MSI
CygWin
Defaults are adapted to MS-Windows mode.
Distribution: source, tar.gz
Apple-MacOS: SnowLeopard(10.6.2)
Requires Python(>=2.7) and bash(>4.1) update
Distribution: source, tar.gz
OpenBSD
Distribution: source
Solaris
Distribution: source
bash: Requires bash for document creation >= 4.1
Perl: Currently basics only, recommended Perl5
Python: Requires Python 2 >= 2.7
Test simulators:
These require an appropriate simulation with minimal common language standard.
bash, Perl, Python,
Install:
Required packages:
- pysourceinfo >=0.1.9 - https://pypi.python.org/pypi/pysourceinfo
- pyfilesysobjects >= 0.1.11 - https://pypi.python.org/pypi/pyfilesysobjects
Standard procedure online local install by sources:
python setup.py install --user
Custom procedure offline by:
python setup.py install --user --offline
Documents, requires Sphinx and Epydoc:
python setup.py build_doc install_doc
Introduction:
For now refer to the listed API and subdocument collection in section ‘Shortcuts’
HowTo¶
Shortcuts¶
Concepts and workflows:
- Rules and Combination Logic [details]
- Integration of PyDev Remote Debug Server ‘pydevd.py’ [shortcuts] [example] [details] [PyDev-Online-Manual]
Use-Cases [usecases]
- Types of Call Interfaces [usecases]
- Selected Use-Cases [usecases]
- Types of Simulator Responses [usecases]
- Types of Expected Test Results [usecases]
- Subprocess Debugging [usecases]
- Project Applications¶ [usecases]
Interfaces:
- Commandline Interface [call-interface]
- Programming Interface [API-Selection]
- Test data generators [myscript.<prog-language>]
Technical API:
- Interface in javadoc-style [API]
Table of Contents¶
- API Shortcuts - epyunit
- UseCase-Shortcuts - Selected Common UsesCases
- Call Integration into PyUnit
- Automation of Subprocess Debugging and Test-Integration of pydevd.py
- ‘epyunit’ - Command line interface
- ‘epyd’ - Command line interface for pydevd.py
- ‘epyunit’ - package
- Commandline tools
- epyunit - Test Syntax, Rules, and Correlation
- Rules and Combination Logic Shortcuts
- ‘epyunit.SubprocUnit’ - Module
- ‘epyunit.SystemCalls’ - Module
- ‘epyunit.selftest’ - Module
- ‘epyunit.debug.pydevrdc’ - Module
- ‘epyunit.debug.pydevrdc’ - Module
- ‘myscript.py’ - Module
- UseCases package
- tests package
- testdata package
- ‘epyunit.CLIOptUtils’ - Module
- Commandline tools
- Command line call examples
- PyDev call examples within Eclipse - Call of Executable
- Commandline Interface for Scripting
- Software Design - A Blueprint
setup.py
For help on extensions to standard options call onlinehelp:
python setup.py --help-epyunit
Indices and tables¶
Resources¶
For available downloads refer to:
- Python Package Index: https://pypi.python.org/pypi/epyunit
- Sourceforge.net: https://sourceforge.net/projects/epyunit/
- github.com: https://github.com/ArnoCan/epyunit/
For Licenses refer to enclosed documents:
- Artistic-License-2.0(base license): ArtisticLicense20.html
- Forced-Fairplay-Constraints(amendments): licenses-amendments.txt / Protect OpenSource Authors
Project data summary:
PROJECT=epyunit
MISSION=Support extensions for executables as Units of PyUnit.
AUTHOR=Arno-Can Uestuensoez
COPYRIGHT=Copyright (C) 2010,2011,2015-2016 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez
LICENSE=Artistic-License-2.0 + Forced-Fairplay-Constraints
VERSION=0.2.12
RELEASE=0.2.12
STATUS=alpha
NICKNAME=Dromi
Dromi see The second chain of Fenrir...