From 2a1c57d12d1d6e3892ca86bd65192d7300246cb5 Mon Sep 17 00:00:00 2001 From: Yuri Bochkarev Date: Sun, 20 Feb 2022 14:05:47 +0100 Subject: [PATCH] tests: integration: more makefile commands --- Makefile | 14 ++++++++++++++ requirements/base.txt | 3 ++- Dockerfile => smoke.Dockerfile | 4 ++-- test_build_install_run.sh | 1 - 4 files changed, 18 insertions(+), 4 deletions(-) rename Dockerfile => smoke.Dockerfile (56%) diff --git a/Makefile b/Makefile index 0c86aad..770e7dc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,18 @@ +unit-test: + pytest +smoke-test: + rm -rf ./dist && \ + python setup.py sdist bdist_wheel && \ + docker build -t brotab-smoke -f smoke.Dockerfile . && \ + docker run -it brotab-smoke + +integration-test: + docker build -t brotab-integration -f jess.Dockerfile . && \ + docker run -v "$(pwd):/brotab" -p 19222:9222 -p 14625:4625 -it --rm --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v /dev/shm:/dev/shm brotab-integration + +integration-run: + docker run -v "$(pwd):/brotab" -p 19222:9222 -p 14625:4625 -it --rm --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v /dev/shm:/dev/shm brotab-integration all: echo ALL diff --git a/requirements/base.txt b/requirements/base.txt index fee1226..3c16fbd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,2 +1,3 @@ Flask==2.0.2 -requests==2.24.0 \ No newline at end of file +requests==2.24.0 +psutil==5.8.0 \ No newline at end of file diff --git a/Dockerfile b/smoke.Dockerfile similarity index 56% rename from Dockerfile rename to smoke.Dockerfile index 3c8c2ad..5081b75 100644 --- a/Dockerfile +++ b/smoke.Dockerfile @@ -2,8 +2,8 @@ FROM python:3.8 WORKDIR /app -COPY "requirements/base.txt" ./ -RUN pip install --no-cache-dir -r "base.txt" +COPY "requirements/base.txt" /tmp/base.txt +RUN pip install --no-cache-dir -r "/tmp/base.txt" COPY dist/* ./ COPY test_build_install_run.sh . diff --git a/test_build_install_run.sh b/test_build_install_run.sh index da6e1ad..bd2b746 100755 --- a/test_build_install_run.sh +++ b/test_build_install_run.sh @@ -23,4 +23,3 @@ run bt active run bt words run bt text run bt html -