From 233189e4f79de42bad53547217c61d68c1ee3a9d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 12 Oct 2025 19:20:28 +0200 Subject: [PATCH] Build - Splitting memory report (#3493) --- .../test-stack-reusable-workflow.yml | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stack-reusable-workflow.yml b/.github/workflows/test-stack-reusable-workflow.yml index 64603ff4..0627c1e5 100644 --- a/.github/workflows/test-stack-reusable-workflow.yml +++ b/.github/workflows/test-stack-reusable-workflow.yml @@ -246,20 +246,36 @@ jobs: # @todo - scan the container log to see the right "graceful shutdown" text exists docker rm sig-test - - name: Dump container log and memory report + - name: Dump container log if: always() run: | mkdir output-logs docker logs test-cdio-basic-tests > output-logs/test-cdio-basic-tests-stdout-${{ env.PYTHON_VERSION }}.txt docker logs test-cdio-basic-tests 2> output-logs/test-cdio-basic-tests-stderr-${{ env.PYTHON_VERSION }}.txt + - name: Extract and display memory test report + if: always() + run: | # Extract test-memory.log from the container echo "Extracting test-memory.log from container..." docker cp test-cdio-basic-tests:/app/changedetectionio/test-memory.log output-logs/test-memory-${{ env.PYTHON_VERSION }}.log || echo "test-memory.log not found in container" # Display the memory log contents for immediate visibility in workflow output - echo "=== Memory Test Report ===" - cat output-logs/test-memory-${{ env.PYTHON_VERSION }}.log 2>/dev/null || echo "No memory log available" + echo "=== Top 10 Highest Peak Memory Tests ===" + if [ -f output-logs/test-memory-${{ env.PYTHON_VERSION }}.log ]; then + # Sort by peak memory value (extract number before MB and sort numerically, reverse order) + grep "Peak memory:" output-logs/test-memory-${{ env.PYTHON_VERSION }}.log | \ + sed 's/.*Peak memory: //' | \ + paste -d'|' - <(grep "Peak memory:" output-logs/test-memory-${{ env.PYTHON_VERSION }}.log) | \ + sort -t'|' -k1 -nr | \ + cut -d'|' -f2 | \ + head -10 + echo "" + echo "=== Full Memory Test Report ===" + cat output-logs/test-memory-${{ env.PYTHON_VERSION }}.log + else + echo "No memory log available" + fi - name: Store everything including test-datastore if: always()