2020-06-02 22:48:57 +01:00
|
|
|
from invoke import task
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
2020-07-08 07:38:12 +01:00
|
|
|
def daemon(c):
|
|
|
|
"""
|
|
|
|
Runs core-daemon.
|
|
|
|
"""
|
|
|
|
with c.cd("daemon"):
|
|
|
|
poetry = c.run("which poetry").stdout.strip()
|
|
|
|
c.run(
|
|
|
|
f"sudo {poetry} run scripts/core-daemon "
|
|
|
|
"-f data/core.conf -l data/logging.conf"
|
|
|
|
)
|
2020-06-02 22:48:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
2020-07-08 07:38:12 +01:00
|
|
|
def gui(c):
|
|
|
|
"""
|
|
|
|
Run core-pygui.
|
|
|
|
"""
|
|
|
|
with c.cd("daemon"):
|
|
|
|
c.run("poetry run scripts/core-pygui")
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
def test(c):
|
|
|
|
"""
|
|
|
|
Run core tests.
|
|
|
|
"""
|
|
|
|
with c.cd("daemon"):
|
|
|
|
poetry = c.run("which poetry").stdout.strip()
|
|
|
|
c.run(f"sudo {poetry} run pytest -v --lf -x tests", pty=True)
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
def test_mock(c):
|
|
|
|
"""
|
|
|
|
Run core tests using mock to avoid running as sudo.
|
|
|
|
"""
|
|
|
|
with c.cd("daemon"):
|
|
|
|
c.run("poetry run pytest -v --mock --lf -x tests", pty=True)
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
def test_emane(c):
|
|
|
|
"""
|
|
|
|
Run core emane tests.
|
|
|
|
"""
|
|
|
|
with c.cd("daemon"):
|
|
|
|
poetry = c.run("which poetry").stdout.strip()
|
|
|
|
c.run(f"sudo {poetry} run pytest -v --lf -x tests/emane", pty=True)
|