-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile.test
More file actions
43 lines (34 loc) · 1.11 KB
/
Dockerfile.test
File metadata and controls
43 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Dockerfile for running functional tests against real databases
FROM eclipse-temurin:21-jdk-jammy
# Install Python and system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*
# Set up working directory
WORKDIR /app
# Create virtual environment
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
# Copy package files
COPY pyproject.toml setup.py README.md ./
COPY src/ ./src/
# Install the package and test dependencies
RUN pip install --upgrade pip && \
pip install -e ".[dev]" && \
pip install pytest pytest-cov pytest-asyncio
# Copy test files
COPY tests/ ./tests/
# Create directory for test results
RUN mkdir -p /app/test-results
# Set JAVA_HOME
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Default command: run functional tests
CMD ["pytest", "tests/docker/", "-v", "--tb=short", \
"--junitxml=/app/test-results/results.xml", \
"--cov=sqlalchemy_jdbcapi", \
"--cov-report=xml:/app/test-results/coverage.xml"]