From: Vsevolod Stakhov Date: Wed, 22 Oct 2025 10:13:18 +0000 (+0100) Subject: [Test] Use locally built Rspamd in integration tests instead of prebuilt image X-Git-Tag: 3.14.0~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef72d32918794f719211de4f2b933b8cce225b18;p=thirdparty%2Frspamd.git [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. --- diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index ab5f4b9973..8183fdfe64 100644 --- a/.github/workflows/integration-test.yml +++ b/.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: | diff --git a/test/integration/.dockerignore b/test/integration/.dockerignore new file mode 100644 index 0000000000..e3162514dd --- /dev/null +++ b/test/integration/.dockerignore @@ -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 index 0000000000..c5c03de027 --- /dev/null +++ b/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"] diff --git a/test/integration/docker-compose.yml b/test/integration/docker-compose.yml index a3b0277ec2..012932d45e 100644 --- a/test/integration/docker-compose.yml +++ b/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: