Skip to content

Commit

Permalink
tests: venv mitmproxy to avoid conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Feb 10, 2025
1 parent 988c060 commit 4388f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,16 @@ jobs:
${{ env.cache-name }}-
- name: Install mitmproxy
run: |
sudo apt update
/usr/bin/pip install -U mitmproxy
/usr/bin/python -m venv --system-site-packages ~/.mitmproxy/venv
. ~/.mitmproxy/venv/activate
pip install -U mitmproxy
# https://github.com/DevToys-app/DevToys/issues/1373#issuecomment-2599820594
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: Run pytest
env:
mitmdump: ~/.mitmproxy/venv/bin/mitmdump
run: scripts/run_cached_tests
6 changes: 4 additions & 2 deletions scripts/run_cached_tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash -e

mitmdump=${mitmdump:-mitmdump}

if [[ -f ~/.mitmproxy/nvdump ]]; then
mitmdump -S ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' --server-replay-reuse --server-replay-extra=forward -w newdump >/dev/null &
$mitmdump -S ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' --server-replay-reuse --server-replay-extra=forward -w newdump >/dev/null &
else
mitmdump -w ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' >/dev/null &
$mitmdump -w ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' >/dev/null &
fi

mitm_pid=$!
Expand Down

0 comments on commit 4388f01

Please sign in to comment.