]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Use locally built Rspamd in integration tests instead of prebuilt image
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Oct 2025 10:13:18 +0000 (11:13 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Oct 2025 10:17:48 +0000 (11:17 +0100)
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.

.github/workflows/integration-test.yml
test/integration/.dockerignore [new file with mode: 0644]
test/integration/Dockerfile.local [new file with mode: 0644]
test/integration/docker-compose.yml

index ab5f4b9973ece85d47b6cae9cc7f68dc632dc0a0..8183fdfe64953956dc122731bbdfcd17f23da8bc 100644 (file)
@@ -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: |
diff --git a/test/integration/.dockerignore b/test/integration/.dockerignore
new file mode 100644 (file)
index 0000000..e316251
--- /dev/null
@@ -0,0 +1,4 @@
+data/
+*.log
+.env.keys
+docker-compose.yml
diff --git a/test/integration/Dockerfile.local b/test/integration/Dockerfile.local
new file mode 100644 (file)
index 0000000..c5c03de
--- /dev/null
@@ -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"]
index a3b0277ec2e6e532a56a0516837d369aa26a7787..012932d45e37ebad9d97c8a6ddd746516791e9ef 100644 (file)
@@ -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: