test(dr): read the no-volume start log from a file

grep -q stops at the first match, and with pipefail the SIGPIPE that then
ends docker logs read as a miss, so the drill failed on a line that was
there. The Dockerfile notes that the dump directory keeps nothing without
a mount.
This commit is contained in:
Marc-André Bombeck committed 2026-10-25 16:35:01 +01:00
1 parent 6b9b9a3f8d
commit 104bb35919
2 files changed
+6 -1

No files matched your search

+2
View File
@@ -120,6 +120,8 @@ RUN addgroup --system --gid 1001 nodejs && \
# Where the database dumps go (`DB_BACKUP_DIR`). Owned by the app user, so a
# fresh named volume mounted here starts with that owner: Docker fills an
# empty named volume from the image directory it covers, ownership included.
# Without a mount the directory stays in the container's layer; the app reads
# its mount table, sees that, and keeps no dump here (dump-core.mjs).
RUN mkdir -p /var/lib/healthlog/backups && \
chown nextjs:nodejs /var/lib/healthlog/backups && \
chmod 700 /var/lib/healthlog/backups
+4 -1
View File
@@ -210,7 +210,10 @@ done
fail "without the volume the run read '$RUN', not 'succeeded not_persistent uploaded'"
LEFT=$(docker exec "$PROJECT-app" sh -c 'ls -A /var/lib/healthlog/backups')
[ -z "$LEFT" ] || fail "a dump was left in the container's layer: $LEFT"
docker logs "$PROJECT-app" 2>&1 | grep -q "is inside the container, not on a mounted volume" ||
# Into a file first: `grep -q` stops reading at the match, and with pipefail
# the SIGPIPE that leaves `docker logs` would read as a miss.
docker logs "$PROJECT-app" >"$WORK/no-volume.log" 2>&1
grep -q "is inside the container, not on a mounted volume" "$WORK/no-volume.log" ||
fail "the start log does not say the dump directory is inside the container"
echo " $RUN, nothing in the container's layer"
stack down -v --remove-orphans >/dev/null 2>&1