Split tox step out of test pipelines

This commit is contained in:
IamTheFij 2020-01-10 15:56:47 -08:00
parent 1251532ca6
commit c9eaaaa45c

View File

@ -25,13 +25,13 @@ def get_workspace():
# Builds a list of all test pipelines to be executed
def build_test_pipelines():
test_pipelines = [
test("python:3.5"),
test("python:3.6"),
test("python:3.7"),
test("python:3.8"),
test("python:3"),
test("pypy:3.6", "pypy3", "pypy3"),
test("pypy:3", "pypy3", "pypy3"),
test_pipeline("python:3.5"),
test_pipeline("python:3.6"),
test_pipeline("python:3.7"),
test_pipeline("python:3.8"),
test_pipeline("python:3"),
test_pipeline("pypy:3.6", "pypy3", "pypy3"),
test_pipeline("pypy:3", "pypy3", "pypy3"),
]
# Converge all tests on a single pipeline "py-tests"
@ -55,14 +55,22 @@ def wait_for_all_tests(test_pipelines, name="py-tests"):
# Builds a single test pipeline
def test(docker_tag, python_cmd="python", tox_env="py3"):
def test_pipeline(docker_tag, python_cmd="python", tox_env="py3"):
return {
"kind": "pipeline",
"name": "test {}".format(docker_tag.replace(":", "")),
"workspace": get_workspace(),
"steps": [
{
"name": "test",
tox(docker_tag, python_cmd, tox_env),
notify_step(),
]
}
# Builds a single python test step
def tox(docker_tag, python_cmd="python", tox_env="py3"):
return {
"name": "test {}".format(docker_tag.replace(":", "")),
"image": docker_tag,
"environment": {
"TOXENV": tox_env,
@ -72,9 +80,6 @@ def test(docker_tag, python_cmd="python", tox_env="py3"):
"pip install tox",
"tox",
],
},
notify_step()
]
}