Browse Source

[Test] Use locally built Rspamd in integration tests instead of prebuilt image

Changed integration test setup to build and test the current code
instead of using the asan-nightly Docker image:

- Modified docker-compose.yml to use local build via Dockerfile.local
- Created Dockerfile.local with ASAN-enabled Ubuntu 24.04 base
- Removed redundant docker-compose modification step from workflow
- Added .dockerignore to exclude test data from build context

This ensures integration tests actually test the code changes being
made in pull requests, not an outdated nightly build.
pull/5707/head
Vsevolod Stakhov 6 days ago
parent
commit
ef72d32918
No known key found for this signature in database GPG Key ID: 7647B6790081437
  1. 40
      .github/workflows/integration-test.yml
  2. 4
      test/integration/.dockerignore
  3. 30
      test/integration/Dockerfile.local
  4. 4
      test/integration/docker-compose.yml

40
.github/workflows/integration-test.yml

@ -145,46 +145,6 @@ jobs:
# The archive contains a 'corpus' directory, so we should have data/corpus/ now
ls -lh data/corpus/
- name: Update Docker Compose to use local build
working-directory: test/integration
run: |
# Create Dockerfile for local build
cat > Dockerfile.local <<'EOF'
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
redis-tools \
curl \
ca-certificates \
libluajit-5.1-2 \
libglib2.0-0 \
libssl3 \
libicu74 \
libsodium23 \
libhyperscan5 \
libpcre2-8-0 \
libjemalloc2 \
libmagic1 \
libarchive13 \
libzstd1 \
libbrotli1 \
libfann2 \
libstemmer0d \
libasan8 \
&& rm -rf /var/lib/apt/lists/*
COPY install /usr
RUN mkdir -p /var/lib/rspamd /var/log/rspamd /var/run/rspamd
EXPOSE 11333 11334 11335
CMD ["/usr/bin/rspamd", "-f", "-c", "/etc/rspamd/rspamd.conf"]
EOF
# Update docker-compose to use local build
sed -i 's|image: ghcr.io/rspamd/rspamd:latest|build:\n context: ../..\n dockerfile: test/integration/Dockerfile.local|g' docker-compose.yml
- name: Start Docker Compose
working-directory: test/integration
run: |

4
test/integration/.dockerignore

@ -0,0 +1,4 @@
data/
*.log
.env.keys
docker-compose.yml

30
test/integration/Dockerfile.local

@ -0,0 +1,30 @@
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
redis-tools \
curl \
ca-certificates \
libluajit-5.1-2 \
libglib2.0-0 \
libssl3 \
libicu74 \
libsodium23 \
libhyperscan5 \
libpcre2-8-0 \
libjemalloc2 \
libmagic1 \
libarchive13 \
libzstd1 \
libbrotli1 \
libfann2 \
libstemmer0d \
libasan8 \
&& rm -rf /var/lib/apt/lists/*
COPY install /usr
RUN mkdir -p /var/lib/rspamd /var/log/rspamd /var/run/rspamd
EXPOSE 11333 11334 11335
CMD ["/usr/bin/rspamd", "-f", "-c", "/etc/rspamd/rspamd.conf"]

4
test/integration/docker-compose.yml

@ -11,7 +11,9 @@ services:
retries: 5
rspamd:
image: rspamd/rspamd:asan-nightly
build:
context: ../..
dockerfile: test/integration/Dockerfile.local
container_name: rspamd-main
depends_on:
redis:

Loading…
Cancel
Save