From e1bf5d2f0965f6e9e0d6b5a9f1febbedd413f4e5 Mon Sep 17 00:00:00 2001 From: blob42 Date: Thu, 18 May 2023 20:09:49 +0200 Subject: [PATCH] enable test + lint on docker --- docker/Dockerfile | 2 +- docker/Makefile | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 918e4ddf..1711430f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -65,7 +65,7 @@ COPY poetry.* pyproject.toml ./ RUN mkdir /pip-prefix -RUN poetry export $POETRY_EXTRA_PACKAGES --with dev -f requirements.txt --output requirements.txt --without-hashes && \ +RUN poetry export $POETRY_EXTRA_PACKAGES --with dev,test,lint -f requirements.txt --output requirements.txt --without-hashes && \ pip install --no-cache-dir --disable-pip-version-check --prefix /pip-prefix -r requirements.txt diff --git a/docker/Makefile b/docker/Makefile index 5f9dd331..e44dec11 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -50,3 +50,15 @@ docker.force_build: $(DOCKER_SRC) docker.clean: docker rmi $(DOCKER_IMAGE_NAME):$(GIT_HASH) $(DOCKER_IMAGE_NAME):latest + +docker.test: docker.build + docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH) \ + pytest /src/tests/unit_tests + +docker.lint: docker.build + $(eval DOCKER_CMD = docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH)) + + $(DOCKER_CMD) mypy /src + $(DOCKER_CMD) black /src --check + $(DOCKER_CMD) isort /src --check + $(DOCKER_CMD) flake8 /src --check