-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathpylauncher.py
46 lines (37 loc) · 1.13 KB
/
pylauncher.py
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
"""
Pylauncher tasks
"""
from __future__ import print_function
import os
from invoke import task
from .build_tags import get_default_build_tags
from .utils import REPO_PATH, bin_name, get_root
#constants
PYLAUNCHER_BIN_PATH = os.path.join(get_root(), "bin", "pylauncher")
@task
def build(ctx, rebuild=False):
"""
Build the pylauncher executable
"""
build_tags = get_default_build_tags() # pass all the build flags
cmd = "go build {build_type} -tags \"{build_tags}\" -o {bin_name} {REPO_PATH}/cmd/py-launcher/"
args = {
"build_type": "-a" if rebuild else "",
"build_tags": " ".join(build_tags),
"bin_name": os.path.join(PYLAUNCHER_BIN_PATH, bin_name("pylauncher")),
"REPO_PATH": REPO_PATH,
}
ctx.run(cmd.format(**args))
@task()
def system_tests(ctx, skip_build=False):
"""
Run the system testsuite.
"""
if not skip_build:
print("Building pylauncher...")
build(ctx)
env = {
"PYLAUNCHER_BIN": os.path.join(PYLAUNCHER_BIN_PATH, bin_name("pylauncher"))
}
with ctx.cd("./test/system/python_binding"):
ctx.run("./test.sh", env=env)