]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Fix fuzzy detection and enable ASAN
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 19:54:01 +0000 (20:54 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 19:54:01 +0000 (20:54 +0100)
- Scan same shuffled files used for training to get accurate fuzzy detection rate
- Build with AddressSanitizer enabled (-DENABLE_SANITIZER=address)
- Add libasan8 and missing runtime libraries to Docker container

.github/workflows/integration-test.yml
test/integration/scripts/integration-test.sh

index 2be7de962e3507d60f08d62a5fc737a80f24de6f..7f086204c8a4f8e92834f3ca42a055a55eee244f 100644 (file)
@@ -72,6 +72,8 @@ jobs:
           cd build
           cmake -DCMAKE_INSTALL_PREFIX=../install \
                 -DENABLE_COVERAGE=OFF \
+                -DENABLE_SANITIZER=address \
+                -DSANITIZER=address \
                 -GNinja ..
           ninja
           ninja install
@@ -161,6 +163,15 @@ jobs:
               libicu74 \
               libsodium23 \
               libhyperscan5 \
+              libpcre2-8-0 \
+              libjemalloc2 \
+              libmagic1 \
+              libarchive13 \
+              libzstd1 \
+              libbrotli1 \
+              libfann2 \
+              libstemmer0d \
+              libasan8 \
               && rm -rf /var/lib/apt/lists/*
 
           COPY install /usr
index 2e97c0a614693c85b824459211bc42181a35b681..91a644c0ab1fdc2dd51ae6ddc65152254f22381a 100755 (executable)
@@ -154,9 +154,10 @@ echo "============================================================"
 echo ""
 
 echo "Scanning $TOTAL_EMAILS emails (parallelism: $PARALLEL)..."
-# rspamc can scan directories recursively
-rspamc -h "$RSPAMD_HOST:$CONTROLLER_PORT" -P "$PASSWORD" -n "$PARALLEL" -j \
-    "$CORPUS_DIR" > "$DATA_DIR/scan_results.json" 2>&1
+# Scan the same files we used for training (from shuffled list)
+# Use xargs with -a to read from file and avoid argument list too long
+xargs -a "$DATA_DIR/shuffled_files.txt" rspamc -h "$RSPAMD_HOST:$CONTROLLER_PORT" \
+    -P "$PASSWORD" -n "$PARALLEL" -j > "$DATA_DIR/scan_results.json" 2>&1
 
 echo "✓ Scanning complete"
 echo ""