-
Notifications
You must be signed in to change notification settings - Fork 12
/
tox.ini
62 lines (52 loc) · 2.13 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
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: EPL-2.0
#
# want to use wheels, but that's not officially a tox command yet:
# https://github.com/tox-dev/tox/issues/232
# therefore, falling back to https://github.com/tox-dev/tox/issues/185#issuecomment-308145081
[tox]
envlist = py{2,3}-{venv,lint,unit,e2e,coverage,dev}
skip_missing_interpreters = true
[pytest]
python_files =
tests/unit/*.py
tests/e2e/*.py
norecursedirs = .tox
[testenv]
envdir =
py2: .venv
py3: .venv3
deps =
pip>=9.0.1
wheel
whitelist_externals =
/bin/cp
# MLT_REGISTRY is so you can use gcr and things while testing if you want
passenv = HOME KUBECONFIG TESTFILES TESTOPTS HTTPS_PROXY MLT_REGISTRY
commands =
# install commands first, then test commands
pip wheel -w /tmp/wheelhouse -r requirements.txt -r requirements-dev.txt
dev: pip wheel -w /tmp/wheelhouse -e .
pip install --no-index --find-links=/tmp/wheelhouse -r requirements.txt -r requirements-dev.txt mlt
# can't seem to make editable install use wheels and not result in bad `mlt` package entry point
# so copy good package entry_point made by wheel, then make editable and write over bad entry_point
dev: /bin/cp {envdir}/bin/mlt /tmp/mlt_good_entrypoint.py
dev: pip install -e .
dev: /bin/cp /tmp/mlt_good_entrypoint.py {envdir}/bin/mlt
lint: flake8 mlt
unit: py.test -v --cov-report term-missing --cov-fail-under=90 --cov {envsitepackagesdir}/mlt --cov-report html {env:TESTOPTS:} {env:TESTFILES:tests/unit}
e2e: py.test -vv {env:TESTOPTS:} {env:TESTFILES:tests/e2e}
coverage: coverage report --show-missing --omit='./.tox/*','./tests/*'