Skip to content

Commit d479fc7

Browse files
author
root
committed
finally, all tests on all versions passed
1 parent c2b2204 commit d479fc7

9 files changed

Lines changed: 129 additions & 85 deletions

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Python binary
2-
PYTHON := python
2+
PYTHON := python$(VERSION)
33

44
# Poetry
55
POETRY := poetry
@@ -40,7 +40,7 @@ docker-demo-clean:
4040
docker-demo: docker-demo-build docker-demo-run docker-demo-clean
4141

4242
docker-test-mulvers-build:
43-
docker build -t $(DOCKER_TESTS_MULVER_IMAGE):$(DOCKER_TAG) -f $(DOCKERFILE_TESTS_MULVER_PATH) .
43+
docker build -t $(DOCKER_TESTS_MULVER_IMAGE):$(DOCKER_TAG) --progress=plain -f $(DOCKERFILE_TESTS_MULVER_PATH) .
4444

4545
docker-test-mulvers-run:
4646
docker run --rm $(DOCKER_TESTS_MULVER_IMAGE):$(DOCKER_TAG)
@@ -133,7 +133,7 @@ dev: clean build test
133133
dev-debug: clean build-debug test
134134

135135
install-poetry:
136-
python -m pip install poetry
136+
$(PYTHON) -m pip install poetry
137137

138138
install-dev-deps:
139139
poetry lock
@@ -142,7 +142,7 @@ install-dev-deps:
142142
venv-poetry:
143143
poetry config virtualenvs.in-project true
144144

145-
install-test: install-poetry install-dev-deps venv-poetry dev
145+
install-test: install-poetry venv-poetry install-dev-deps dev
146146

147147
# Help target
148148
help:

poetry.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Dockerfile-test-mul-vers

Lines changed: 0 additions & 75 deletions
This file was deleted.

tests/Dockerfile-test-py3.10

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.10-slim as py3.10
2+
WORKDIR /app
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
make
7+
8+
# Copy application files
9+
COPY newtype/ ./newtype/
10+
COPY tests/ ./tests/
11+
COPY build.py ./
12+
COPY Makefile ./
13+
COPY README.md ./
14+
COPY pyproject.toml ./
15+
16+
RUN python -m venv .venv && \
17+
export PATH=".venv/bin:$PATH" && \
18+
make install-test VERSION=3.10
19+
20+
CMD ["echo", "all tests done"]

tests/Dockerfile-test-py3.11

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.11-slim as py3.11
2+
WORKDIR /app
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
make
7+
8+
# Copy application files
9+
COPY newtype/ ./newtype/
10+
COPY tests/ ./tests/
11+
COPY build.py ./
12+
COPY Makefile ./
13+
COPY README.md ./
14+
COPY pyproject.toml ./
15+
16+
RUN python -m venv .venv && \
17+
export PATH=".venv/bin:$PATH" && \
18+
make install-test VERSION=3.11
19+
20+
CMD ["echo", "all tests done"]

tests/Dockerfile-test-py3.12

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.12-slim as py3.12
2+
WORKDIR /app
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
make
7+
8+
# Copy application files
9+
COPY newtype/ ./newtype/
10+
COPY tests/ ./tests/
11+
COPY build.py ./
12+
COPY Makefile ./
13+
COPY README.md ./
14+
COPY pyproject.toml ./
15+
16+
RUN python -m venv .venv && \
17+
export PATH=".venv/bin:$PATH" && \
18+
make install-test VERSION=3.12
19+
20+
CMD ["echo", "all tests done"]

tests/Dockerfile-test-py3.8

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.8-slim as py3.8
2+
WORKDIR /app
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
make
7+
8+
# Copy application files
9+
COPY newtype/ ./newtype/
10+
COPY tests/ ./tests/
11+
COPY build.py ./
12+
COPY Makefile ./
13+
COPY README.md ./
14+
COPY pyproject.toml ./
15+
16+
RUN python -m venv .venv && \
17+
. .venv/bin/activate && \
18+
make install-test
19+
20+
CMD ["echo", "all tests done"]

tests/Dockerfile-test-py3.9

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.9-slim as py3.9
2+
WORKDIR /app
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
make
7+
8+
# Copy application files
9+
COPY newtype/ ./newtype/
10+
COPY tests/ ./tests/
11+
COPY build.py ./
12+
COPY Makefile ./
13+
COPY README.md ./
14+
COPY pyproject.toml ./
15+
16+
RUN python -m venv .venv && \
17+
export PATH=".venv/bin:$PATH" && \
18+
make install-test VERSION=3.9
19+
20+
CMD ["echo", "all tests done"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Create logs directory if it doesn't exist
4+
mkdir -p ./tests/logs
5+
6+
# Build Docker images in parallel with logging
7+
docker build -t python-newtype-test-mul-vers:3.8 -f ./tests/Dockerfile-test-py3.8 . > ./tests/logs/py3.8-test.log 2>&1 &
8+
docker build -t python-newtype-test-mul-vers:3.9 -f ./tests/Dockerfile-test-py3.9 . > ./tests/logs/py3.9-test.log 2>&1 &
9+
docker build -t python-newtype-test-mul-vers:3.10 -f ./tests/Dockerfile-test-py3.10 . > ./tests/logs/py3.10-test.log 2>&1 &
10+
docker build -t python-newtype-test-mul-vers:3.11 -f ./tests/Dockerfile-test-py3.11 . > ./tests/logs/py3.11-test.log 2>&1 &
11+
docker build -t python-newtype-test-mul-vers:3.12 -f ./tests/Dockerfile-test-py3.12 . > ./tests/logs/py3.12-test.log 2>&1 &
12+
13+
# Wait for all background jobs to finish
14+
wait
15+
16+
# Clean up unused Docker objects
17+
docker system prune -af
18+
19+
echo "All Docker images built successfully."

0 commit comments

Comments
 (0)