Major changes: - Move child state from global variable to server config (reqin_log_server_conf_t) - Add reqin_log_create_server_conf() for proper per-server initialization - Fix thread safety for worker/event MPMs - Add cmocka unit tests (test_module_real.c) - Add Python integration tests (test_integration.py) - Update CI workflow and Dockerfiles for test execution - Fix: Remove child_exit hook (not in architecture.yml) Tests: - Unit tests: JSON escaping, ISO8601 formatting, header truncation - Integration tests: basic_logging, header_limits, socket_unavailable, socket_loss Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
48 lines
972 B
Docker
48 lines
972 B
Docker
# Dockerfile for running unit tests
|
|
FROM rockylinux:8
|
|
|
|
# Install build and test dependencies
|
|
RUN dnf install -y epel-release && \
|
|
dnf install -y \
|
|
gcc \
|
|
make \
|
|
httpd \
|
|
httpd-devel \
|
|
apr-devel \
|
|
apr-util-devel \
|
|
cmake \
|
|
python3 \
|
|
curl \
|
|
git \
|
|
pkgconfig \
|
|
libxml2-devel \
|
|
&& dnf clean all
|
|
|
|
# Build and install cmocka from source
|
|
RUN cd /tmp && \
|
|
git clone https://git.cryptomilk.org/projects/cmocka.git && \
|
|
cd cmocka && \
|
|
git checkout cmocka-1.1.5 && \
|
|
mkdir build && cd build && \
|
|
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release && \
|
|
make && \
|
|
make install && \
|
|
ldconfig && \
|
|
cd / && \
|
|
rm -rf /tmp/cmocka
|
|
|
|
WORKDIR /build
|
|
|
|
COPY src/ src/
|
|
COPY tests/ tests/
|
|
COPY CMakeLists.txt CMakeLists.txt
|
|
COPY Makefile Makefile
|
|
|
|
# Build and run tests
|
|
RUN mkdir -p build/tests && \
|
|
cd build/tests && \
|
|
cmake ../../ && \
|
|
make
|
|
|
|
CMD ["ctest", "--output-on-failure"]
|