Merge pull request #180 from moreati/procedure-033-03
Switch to using unit2 test runnerpull/193/head
commit
772e229b7d
@ -1,7 +1,14 @@
|
|||||||
|
.coverage
|
||||||
|
.tox
|
||||||
.venv
|
.venv
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
|
*.pyc
|
||||||
|
*.pyd
|
||||||
|
*.pyo
|
||||||
MANIFEST
|
MANIFEST
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
docs/_build
|
docs/_build
|
||||||
|
htmlcov/
|
||||||
*.egg-info
|
*.egg-info
|
||||||
|
__pycache__/
|
||||||
|
|||||||
@ -1,3 +1,10 @@
|
|||||||
|
[coverage:run]
|
||||||
|
branch = true
|
||||||
|
source =
|
||||||
|
mitogen
|
||||||
|
omit =
|
||||||
|
mitogen/compat/*
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E402,E128,W503
|
ignore = E402,E128,W503
|
||||||
exclude = mitogen/compat
|
exclude = mitogen/compat
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
#/bin/sh
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
UNIT2="$(which unit2)"
|
||||||
|
|
||||||
|
coverage erase
|
||||||
|
coverage run "${UNIT2}" discover \
|
||||||
|
--start-directory "tests" \
|
||||||
|
--pattern '*_test.py' \
|
||||||
|
"$@"
|
||||||
|
coverage html
|
||||||
|
echo coverage report is at "file://$(pwd)/htmlcov/index.html"
|
||||||
@ -1,63 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
timeout()
|
|
||||||
{
|
|
||||||
python -c '
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
deadline = time.time() + float(sys.argv[1])
|
|
||||||
proc = subprocess.Popen(sys.argv[2:])
|
|
||||||
while time.time() < deadline and proc.poll() is None:
|
|
||||||
time.sleep(1.0)
|
|
||||||
|
|
||||||
if proc.poll() is not None:
|
|
||||||
sys.exit(proc.returncode)
|
|
||||||
proc.terminate()
|
|
||||||
print
|
|
||||||
print >> sys.stderr, "Timeout! Command was:", sys.argv[2:]
|
|
||||||
print
|
|
||||||
sys.exit(1)
|
|
||||||
' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
trap 'sigint' INT
|
|
||||||
sigint()
|
|
||||||
{
|
|
||||||
echo "SIGINT received, stopping.."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
run_test()
|
|
||||||
{
|
|
||||||
echo "Running $1.."
|
|
||||||
timeout 10 python $1 || fail=$?
|
|
||||||
}
|
|
||||||
|
|
||||||
run_test tests/ansible_helpers_test.py
|
|
||||||
run_test tests/call_error_test.py
|
|
||||||
run_test tests/call_function_test.py
|
|
||||||
run_test tests/channel_test.py
|
|
||||||
run_test tests/fakessh_test.py
|
|
||||||
run_test tests/first_stage_test.py
|
|
||||||
run_test tests/fork_test.py
|
|
||||||
run_test tests/id_allocation_test.py
|
|
||||||
run_test tests/importer_test.py
|
|
||||||
run_test tests/latch_test.py
|
|
||||||
run_test tests/local_test.py
|
|
||||||
run_test tests/master_test.py
|
|
||||||
run_test tests/module_finder_test.py
|
|
||||||
run_test tests/nested_test.py
|
|
||||||
run_test tests/parent_test.py
|
|
||||||
run_test tests/receiver_test.py
|
|
||||||
run_test tests/responder_test.py
|
|
||||||
run_test tests/router_test.py
|
|
||||||
run_test tests/select_test.py
|
|
||||||
run_test tests/ssh_test.py
|
|
||||||
run_test tests/utils_test.py
|
|
||||||
|
|
||||||
if [ "$fail" ]; then
|
|
||||||
echo "AT LEAST ONE TEST FAILED" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
Loading…
Reference in New Issue