From 4e20fce82ce4f891229c4fcf21e354a998f3c6c7 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 28 Oct 2025 17:47:32 +0100 Subject: [PATCH] tweaks --- .../actions/extract-memory-report/action.yml | 41 ++++++++++--------- .../test-stack-reusable-workflow.yml | 2 +- changedetectionio/run_proxy_tests.sh | 8 ++++ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/actions/extract-memory-report/action.yml b/.github/actions/extract-memory-report/action.yml index a6f4d685..c7729218 100644 --- a/.github/actions/extract-memory-report/action.yml +++ b/.github/actions/extract-memory-report/action.yml @@ -23,26 +23,29 @@ runs: - name: Dump container log shell: bash run: | - docker logs ${{ inputs.container-name }} > ${{ inputs.output-dir }}/${{ inputs.container-name }}-stdout-${{ inputs.python-version }}.txt 2>&1 || echo "Could not get stdout" - docker logs ${{ inputs.container-name }} 2> ${{ inputs.output-dir }}/${{ inputs.container-name }}-stderr-${{ inputs.python-version }}.txt || echo "Could not get stderr" + echo "Disabled for now" +# return +# docker logs ${{ inputs.container-name }} > ${{ inputs.output-dir }}/${{ inputs.container-name }}-stdout-${{ inputs.python-version }}.txt 2>&1 || echo "Could not get stdout" +# docker logs ${{ inputs.container-name }} 2> ${{ inputs.output-dir }}/${{ inputs.container-name }}-stderr-${{ inputs.python-version }}.txt || echo "Could not get stderr" - name: Extract and display memory test report shell: bash run: | - echo "Extracting test-memory.log from container..." - docker cp ${{ inputs.container-name }}:/app/changedetectionio/test-memory.log ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log || echo "test-memory.log not found in container" - - echo "=== Top 10 Highest Peak Memory Tests ===" - if [ -f ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log ]; then - grep "Peak memory:" ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log | \ - sed 's/.*Peak memory: //' | \ - paste -d'|' - <(grep "Peak memory:" ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log) | \ - sort -t'|' -k1 -nr | \ - cut -d'|' -f2 | \ - head -10 - echo "" - echo "=== Full Memory Test Report ===" - cat ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log - else - echo "No memory log available" - fi + echo "Disabled for now" +# echo "Extracting test-memory.log from container..." +# docker cp ${{ inputs.container-name }}:/app/changedetectionio/test-memory.log ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log || echo "test-memory.log not found in container" +# +# echo "=== Top 10 Highest Peak Memory Tests ===" +# if [ -f ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log ]; then +# grep "Peak memory:" ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log | \ +# sed 's/.*Peak memory: //' | \ +# paste -d'|' - <(grep "Peak memory:" ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log) | \ +# sort -t'|' -k1 -nr | \ +# cut -d'|' -f2 | \ +# head -10 +# echo "" +# echo "=== Full Memory Test Report ===" +# cat ${{ inputs.output-dir }}/test-memory-${{ inputs.python-version }}.log +# else +# echo "No memory log available" +# fi diff --git a/.github/workflows/test-stack-reusable-workflow.yml b/.github/workflows/test-stack-reusable-workflow.yml index bb27b721..e82be2ed 100644 --- a/.github/workflows/test-stack-reusable-workflow.yml +++ b/.github/workflows/test-stack-reusable-workflow.yml @@ -289,7 +289,7 @@ jobs: docker run --network changedet-network -d -e "LOG_LEVEL=TRACE" --cap-add=SYS_ADMIN --name sockpuppetbrowser --hostname sockpuppetbrowser --rm -p 3000:3000 dgtlmoon/sockpuppetbrowser:latest docker run --network changedet-network -d -e "LOG_LEVEL=TRACE" --cap-add=SYS_ADMIN --name sockpuppetbrowser-custom-url --hostname sockpuppetbrowser-custom-url -p 3001:3000 --rm dgtlmoon/sockpuppetbrowser:latest - - name: Test proxy squid style interaction + - name: Test proxy Squid style interaction run: | cd changedetectionio ./run_proxy_tests.sh diff --git a/changedetectionio/run_proxy_tests.sh b/changedetectionio/run_proxy_tests.sh index fe28bb2f..cb701f2e 100755 --- a/changedetectionio/run_proxy_tests.sh +++ b/changedetectionio/run_proxy_tests.sh @@ -28,6 +28,9 @@ docker run --network changedet-network \ test-changedetectionio \ bash -c 'cd changedetectionio && pytest tests/proxy_list/test_multiple_proxy.py' +# Give squid proxies a moment to flush their logs +sleep 2 + set +e echo "- Looking for chosen.changedetection.io request in squid-one - it should NOT be here" docker logs squid-one 2>/dev/null|grep chosen.changedetection.io @@ -52,6 +55,8 @@ docker run --network changedet-network \ test-changedetectionio \ bash -c 'cd changedetectionio && pytest tests/proxy_list/test_select_custom_proxy.py' +# Give squid proxies a moment to flush their logs +sleep 2 # Should see a request for one.changedetection.io in there echo "- Looking for .changedetection.io request in squid-custom" @@ -67,6 +72,9 @@ docker run --network changedet-network \ test-changedetectionio \ bash -c 'cd changedetectionio && pytest tests/proxy_list/test_noproxy.py' +# Give squid proxies a moment to flush their logs +sleep 2 + # We need to handle grep returning 1 set +e # Check request was never seen in any container