-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
98 lines (88 loc) · 3.87 KB
/
tox.ini
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
[tox]
envlist = py3-local_os, py3-dind_os, py3-s2search
skipsdist = true
; set this to a branch of your choice. tox will build this into an image called 'marqo_docker_0'
marqo_branch = {env:MQ_API_TEST_BRANCH:mainline}
; set this to a marqo image you want to test. Leave it as 'marqo_docker_0' to test the docker image
; that this tox script builds. You can set it to a marqo image found on dockerhub.
marqo_image_name = {env:MQ_API_TEST_IMG:marqo_docker_0}
; can either be a branch or the latest pypi release version
py_marqo_package = {env:MQ_PY_MARQO_BRANCH:marqo}
[testenv]
whitelist_externals =
python
bash
docker
deps =
pytest
pillow
numpy
{[tox]py_marqo_package}
commands_pre =
bash {toxinidir}{/}scripts{/}clone_marqo_repo.sh {toxinidir} {[tox]marqo_branch}
bash {toxinidir}{/}scripts{/}pull_remote_image.sh {[tox]marqo_image_name}
commands_post =
- docker rm -f marqo
- docker rm -f vespa
[testenv:py3-local_marqo]
# This test environment assumes that Vespa is running outside of marqo on a cpu-only instance
setenv =
TESTING_CONFIGURATION = CPU_LOCAL_MARQO
PYTHONPATH = {toxinidir}{/}tests{:}{toxinidir}
PATH = {env:PATH}{:}{toxinidir}{/}scripts
; this is set in case test needs to stop & rerun marqo.
MARQO_IMAGE_NAME = {[tox]marqo_image_name}
; Note: instead of setting this here, we could run . conf in the startup script itself
MARQO_API_TESTS_ROOT = {toxinidir}
commands =
bash {toxinidir}{/}scripts{/}start_local_marqo.sh {[tox]marqo_image_name}
pytest {posargs} --ignore={toxinidir}{/}temp --ignore={toxinidir}{/}manual_tests
[testenv:py3-docker_marqo]
# This test environment assumes that Vespa is running inside of marqo docker on a cpu-only instance
setenv =
TESTING_CONFIGURATION = CPU_DOCKER_MARQO
PYTHONPATH = {toxinidir}{/}tests{:}{toxinidir}
PATH = {env:PATH}{:}{toxinidir}{/}scripts
; this is set in case test needs to stop & rerun marqo.
MARQO_IMAGE_NAME = {[tox]marqo_image_name}
; Note: instead of setting this here, we could run . conf in the startup script itself
MARQO_API_TESTS_ROOT = {toxinidir}
commands =
bash {toxinidir}{/}scripts{/}start_docker_marqo.sh {[tox]marqo_image_name}
pytest {posargs} --ignore={toxinidir}{/}temp --ignore={toxinidir}{/}manual_tests
[testenv:py3-cuda_docker_marqo]
# This test environment assumes that Vespa is running inside of marqo docker on a cuda enabled instance
setenv =
TESTING_CONFIGURATION = CUDA_DOCKER_MARQO
PYTHONPATH = {toxinidir}{/}tests{:}{toxinidir}
PATH = {env:PATH}{:}{toxinidir}{/}scripts
; this is set in case test needs to stop & rerun marqo.
MARQO_IMAGE_NAME = {[tox]marqo_image_name}
; might need to be changed to conf MARQO_API_TESTS_ROOT in the future, if tox file moves from the root
MARQO_API_TESTS_ROOT = {toxinidir}
commands =
bash {toxinidir}{/}scripts{/}start_cuda_docker_marqo.sh {[tox]marqo_image_name}
pytest {posargs} --ignore={toxinidir}{/}temp --ignore={toxinidir}{/}manual_tests
[testenv:py3-local_os_unit_tests]
; this test assumes the environment already has the required python packages installed
deps =
{[testenv]deps}
setenv =
TESTING_CONFIGURATION = LOCAL_MARQO_OS_UNIT_TESTS
PYTHONPATH = {toxinidir}{/}tests{:}{toxinidir}{:}{toxinidir}{/}temp{/}marqo{/}src{:}{toxinidir}{/}src
PATH = {env:PATH}{:}{toxinidir}{/}scripts
commands =
bash {toxinidir}{/}scripts{/}start_local_marqo_os_no_marqo.sh
pytest temp{/}marqo{/}tests{/} {posargs}
[testenv:py3-local_os_unit_tests_w_requirements]
; installs pip packages into the testing venv
deps =
{[testenv]deps}
setenv =
TESTING_CONFIGURATION = LOCAL_MARQO_OS_UNIT_TESTS
PYTHONPATH = {toxinidir}{/}tests{:}{toxinidir}{:}{toxinidir}{/}temp{/}marqo{/}src{:}{toxinidir}{/}src
PATH = {env:PATH}{:}{toxinidir}{/}scripts
commands =
pip install --upgrade -r {toxinidir}{/}temp{/}marqo{/}requirements.txt
bash {toxinidir}{/}scripts{/}start_local_marqo_os_no_marqo.sh
pytest temp{/}marqo{/}tests{/} {posargs}