moved tox to testenv

This commit is contained in:
Devaev Maxim 2018-11-16 09:25:39 +03:00
parent 17c6b9e31f
commit cd6e490d0f
9 changed files with 41 additions and 27 deletions

4
.gitignore vendored
View File

@ -1,7 +1,7 @@
/build/
/dist/
/kvmd.egg-info/
/.tox/
/.mypy_cache/
/testenv/.tox/
/testenv/.mypy_cache/
*.pyc
*.swp

View File

@ -22,13 +22,14 @@ all:
cat Makefile
run-no-cache:
make run TESTENV_OPTS=--no-cache
tox: _testenv
- docker run --rm \
--volume `pwd`:/kvmd \
-it $(TESTENV_IMAGE) bash -c "cd kvmd && tox -c testenv/tox.ini"
run:
run: _testenv
sudo modprobe loop
docker build $(TESTENV_OPTS) --rm --tag $(TESTENV_IMAGE) -f testenv/Dockerfile .
- docker run --rm \
--volume `pwd`/kvmd:/kvmd:ro \
--volume `pwd`/web:/usr/share/kvmd/web:ro \
@ -43,6 +44,10 @@ run:
- docker run --rm --device=$(TESTENV_LOOP):/dev/kvmd-msd -it $(TESTENV_IMAGE) losetup -d /dev/kvmd-msd
run-no-cache:
make run TESTENV_OPTS=--no-cache
shell:
make run TESTENV_CMD=/bin/bash
@ -60,11 +65,6 @@ release:
make push
make clean
tox:
tox
bump:
bumpversion minor
@ -76,9 +76,16 @@ push:
clean:
rm -rf build site dist pkg src *.egg-info kvmd-*.tar.gz
find -name __pycache__ | xargs rm -rf
find kvmd -name __pycache__ | xargs rm -rf
rm -rf __pycache__
make -C hid clean
clean-all: clean
rm -rf .tox .mypy_cache
clean-all: _testenv clean
- docker run --rm \
--volume `pwd`:/kvmd \
-it $(TESTENV_IMAGE) bash -c "cd kvmd && rm -rf testenv/{.tox,.mypy_cache}"
_testenv:
docker build $(TESTENV_OPTS) --rm --tag $(TESTENV_IMAGE) -f testenv/Dockerfile .

View File

@ -1,5 +1,7 @@
FROM base/archlinux
RUN dd if=/dev/zero of=/root/loop.img bs=1024 count=1048576
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm \
git \
@ -10,6 +12,8 @@ RUN pacman -Syu --noconfirm \
expac \
jshon \
sudo \
systemd \
pkgconf \
&& pacman -Sc --noconfirm
RUN useradd -r -d / packer \
@ -33,20 +37,23 @@ COPY testenv/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-lua
RUN pacman -Syy \
&& user-packer -S --noconfirm \
customizepkg \
&& mkdir /.npm \
&& chmod 777 /.npm \
&& user-packer -S --noconfirm \
python \
python-pip \
python-systemd \
nginx-mainline \
lua51-cjson \
ustreamer \
socat \
lua51-cjson \
htmlhint \
eslint \
&& rm -rf /.npm \
&& env MAKEPKGOPTS="--skipchecksums --skippgpcheck" user-packer -S --noconfirm nginx-mainline-mod-lua \
&& pacman -Sc --noconfirm
COPY testenv/requirements.txt requirements.txt
RUN pip install -r requirements.txt
RUN dd if=/dev/zero of=/root/loop.img bs=1024 count=1048576
CMD /bin/bash

View File

@ -6,5 +6,4 @@ pyyaml
pyserial
setproctitle
systemd-python
bumpversion
tox

View File

@ -4,35 +4,36 @@ skipsdist = True
[testenv]
basepython = python3.7
changedir = /kvmd
[testenv:flake8]
commands = flake8 kvmd genmap.py
commands = flake8 --config=testenv/tox.ini kvmd genmap.py
deps =
flake8
flake8-double-quotes
-rtestenv/requirements.txt
-rrequirements.txt
[testenv:pylint]
commands = pylint --output-format=colorized --reports=no kvmd genmap.py
commands = pylint --rcfile=testenv/pylintrc --output-format=colorized --reports=no kvmd genmap.py
deps =
pylint
-rtestenv/requirements.txt
-rrequirements.txt
[testenv:mypy]
commands = mypy kvmd genmap.py
commands = mypy --config-file=testenv/mypy.ini --cache-dir=testenv/.mypy_cache kvmd genmap.py
deps =
mypy
-rtestenv/requirements.txt
-rrequirements.txt
[testenv:vulture]
commands = vulture kvmd genmap.py vulture-wl.py
commands = vulture kvmd genmap.py testenv/vulture-wl.py
deps =
vulture
-rtestenv/requirements.txt
-rrequirements.txt
[testenv:eslint]
whitelist_externals = eslint
commands = eslint --config=eslintrc.yaml --color --ext .js web/js
commands = eslint --config=testenv/eslintrc.yaml --color --ext .js web/js
[testenv:htmlhint]
whitelist_externals = htmlhint