-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
58 lines (52 loc) · 1.6 KB
/
tasks.py
File metadata and controls
58 lines (52 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import pathlib
import subprocess
from invoke import task
from JMS import __version__ as VERSION
import inspect
if not hasattr(inspect, 'getargspec'):
inspect.getargspec = inspect.getfullargspec
ROOT = pathlib.Path(__file__).parent.resolve().as_posix()
@task
def libdoc(context):
source = f"{ROOT}/JMS/JMS.py"
target = f"{ROOT}/docs/JMS.html"
cmd = [
"python",
"-m",
"robot.libdoc",
"-n JMS",
f"-v {VERSION}",
source,
target,
]
subprocess.run(" ".join(cmd), shell=True)
@task
def atests(context):
cmd = [
"coverage",
"run",
"--source=JMS",
"-p",
"-m",
"robot",
"--loglevel=TRACE:DEBUG",
"--listener RobotStackTracer",
"--exclude appiumORnot_readyORnot_ci",
"-d results",
"--prerebotmodifier utilities.xom.XUnitOut:results/xunit.xml",
f"{ROOT}/tests/atest"
]
global atests_completed_process
atests_completed_process = subprocess.run(" ".join(cmd), shell=True, check=False)
@task(atests)
def tests(context):
subprocess.run("coverage combine", shell=True, check=False)
subprocess.run("coverage report", shell=True, check=False)
subprocess.run("coverage html -d results/htmlcov", shell=True, check=False)
if atests_completed_process.returncode != 0:
raise Exception("Tests failed")
@task
def coverage_report(context):
subprocess.run("coverage combine", shell=True, check=False)
subprocess.run("coverage report", shell=True, check=False)
subprocess.run("coverage html -d results/htmlcov", shell=True, check=False)