Tests are running in dev env
This commit is contained in:
parent
625d1e0402
commit
a6e2f4f382
|
@ -1,7 +0,0 @@
|
|||
FROM python:alpine AS base
|
||||
|
||||
RUN \
|
||||
--mount=type=cache,target=/var/cache/apk \
|
||||
apk add -U make
|
||||
|
||||
WORKDIR /app
|
12
Makefile
12
Makefile
|
@ -1,7 +1,19 @@
|
|||
SRC := spiff_element_units
|
||||
TESTS := tests
|
||||
|
||||
DEV_SERVICE := dev
|
||||
|
||||
MY_USER := $(shell id -u)
|
||||
MY_GROUP := $(shell id -g)
|
||||
ME := $(MY_USER):$(MY_GROUP)
|
||||
AS_ME := docker compose run -u $(ME) $(DEV_SERVICE)
|
||||
|
||||
.PHONY: all
|
||||
all: dev-env
|
||||
|
||||
dev-env:
|
||||
docker compose build --progress=plain $(DEV_SERVICE)
|
||||
|
||||
.PHONY: tests
|
||||
tests:
|
||||
$(AS_ME) unittest-parallel -vs $(TESTS) -p test_*.py -t .
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
FROM python:alpine AS base
|
||||
|
||||
RUN \
|
||||
--mount=type=cache,target=/var/cache/apk \
|
||||
apk add -U make
|
||||
|
||||
RUN python -m pip install --upgrade pip
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY dev/requirements.txt .
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
@ -0,0 +1 @@
|
|||
unittest-parallel == 1.5.3
|
|
@ -2,4 +2,8 @@ services:
|
|||
dev:
|
||||
container_name: spiff-element-units-dev
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: dev/Dockerfile
|
||||
volumes:
|
||||
- ./spiff_element_units:/app/spiff_element_units
|
||||
- ./tests:/app/tests
|
|
@ -0,0 +1,2 @@
|
|||
def this_returns_true():
|
||||
return True
|
|
@ -0,0 +1,7 @@
|
|||
from unittest import TestCase
|
||||
|
||||
from spiff_element_units import this_returns_true
|
||||
|
||||
class SanityTest(TestCase):
|
||||
def test_it_returns_true(self):
|
||||
assert this_returns_true()
|
Loading…
Reference in New Issue