From fc6424c39ec19df32027bcf9d577b4955b888b9b Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 26 Dec 2022 14:17:40 +0100 Subject: [PATCH] Test improvements (#1264) --- .github/workflows/test-only.yml | 1 - changedetectionio/run_proxy_tests.sh | 4 +++- .../tests/proxy_list/test_select_custom_proxy.py | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-only.yml b/.github/workflows/test-only.yml index 93c6c108..f6d5a872 100644 --- a/.github/workflows/test-only.yml +++ b/.github/workflows/test-only.yml @@ -60,7 +60,6 @@ jobs: cd changedetectionio ./run_proxy_tests.sh cd .. - - name: Test changedetection.io container starts+runs basically without error run: | diff --git a/changedetectionio/run_proxy_tests.sh b/changedetectionio/run_proxy_tests.sh index a7ac8805..1761bae1 100755 --- a/changedetectionio/run_proxy_tests.sh +++ b/changedetectionio/run_proxy_tests.sh @@ -11,7 +11,7 @@ docker run --network changedet-network -d --name squid-two --hostname squid-two # Used for configuring a custom proxy URL via the UI docker run --network changedet-network -d \ --name squid-custom \ - --hostname squid-squid-custom \ + --hostname squid-custom \ --rm \ -v `pwd`/tests/proxy_list/squid-auth.conf:/etc/squid/conf.d/debian.conf \ -v `pwd`/tests/proxy_list/squid-passwords.txt:/etc/squid3/passwords \ @@ -57,3 +57,5 @@ then echo "Did not see a valid request to changedetection.io in the squid logs (while checking preferred proxy - squid two)" exit 1 fi + +docker kill squid-one squid-two squid-custom diff --git a/changedetectionio/tests/proxy_list/test_select_custom_proxy.py b/changedetectionio/tests/proxy_list/test_select_custom_proxy.py index 2f803f54..2bc7e0ad 100644 --- a/changedetectionio/tests/proxy_list/test_select_custom_proxy.py +++ b/changedetectionio/tests/proxy_list/test_select_custom_proxy.py @@ -38,13 +38,12 @@ def test_select_custom(client, live_server): res = client.get(url_for("index")) assert b'Proxy Authentication Required' not in res.data - res = client.get( url_for("preview_page", uuid="first"), follow_redirects=True ) # We should see something via proxy - assert b'HEAD' in res.data + assert b'
- 0.' in res.data # # Now we should see the request in the container logs for "squid-squid-custom" because it will be the only default