testing python script issues

This commit is contained in:
ssrlive 2024-09-26 11:02:33 +08:00
parent 6c8ae7a33f
commit b24d48a042
2 changed files with 21 additions and 7 deletions

View file

@ -24,10 +24,24 @@ jobs:
env: env:
DOTENV: ${{ secrets.DOTENV }} DOTENV: ${{ secrets.DOTENV }}
run: echo "$DOTENV" > .env run: echo "$DOTENV" > .env
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Create virtual environment
run: python -m venv venv
- name: Activate virtual environment and install dependencies
run: |
source venv/bin/activate
pip install -r tests/requirements.txt
- name: Build project
run: cargo build --release
- name: Run tests - name: Run tests
run: >- run: |
pwd; source venv/bin/activate
ls -la; python tests/tests.py
sudo python -m pip install -r tests/requirements.txt;
cargo build --release;
sudo python tests/tests.py

View file

@ -40,7 +40,7 @@ class Tun2ProxyTest(unittest.TestCase):
ip_noproxy = get_ip(ip_version) ip_noproxy = get_ip(ip_version)
additional = ['-6'] if ip_version == 6 else [] additional = ['-6'] if ip_version == 6 else []
p = subprocess.Popen( p = subprocess.Popen(
[get_tool_path(), "--proxy", os.getenv(proxy_var), '--setup', '-v', 'trace', '--dns', dns, *additional]) ['sudo', get_tool_path(), "--proxy", os.getenv(proxy_var), '--setup', '-v', 'trace', '--dns', dns, *additional])
try: try:
time.sleep(1) time.sleep(1)
ip_withproxy = get_ip(ip_version) ip_withproxy = get_ip(ip_version)