Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/gh-3101' into gh-3101
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Jan 8, 2025
2 parents 5d7b359 + 065890f commit 07c75bd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ jobs:
}}-${{ hashFiles('requirements.txt') }}

- name: Set system-wide proxy using PAC URL
run: echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" | sudo tee -a /etc/environment
env:
auto_proxy: http://proxy-doc.ird.fr/proxy.pac
run: |
echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" | sudo tee -a /etc/environment
echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" >> $GITHUB_ENV
- name: Verify proxy settings
run: env | grep -i proxy
Expand All @@ -160,6 +160,7 @@ jobs:
sudo apt-get update
sudo apt-get install ${{ matrix.client }}
sudo apt-get install mesa-utils xvfb
sudo apt-get install wmctrl xdotool
curl -LO https://github.com/jgm/pandoc/releases/download/3.1.11.1/pandoc-3.1.11.1-linux-amd64.tar.gz
tar xvzf pandoc-3.1.11.1-linux-amd64.tar.gz
sudo mv pandoc-3.1.11.1/bin/pandoc /usr/bin
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/src/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ jobs:
- *cache

- name: Set system-wide proxy using PAC URL
run: echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" | sudo tee -a /etc/environment
env:
auto_proxy: http://proxy-doc.ird.fr/proxy.pac
run: |
echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" | sudo tee -a /etc/environment
echo "auto_proxy=http://proxy-doc.ird.fr/proxy.pac" >> $GITHUB_ENV
- name: Verify proxy settings
run: env | grep -i proxy
Expand All @@ -149,6 +149,7 @@ jobs:
sudo apt-get update
sudo apt-get install ${{ matrix.client }}
sudo apt-get install mesa-utils xvfb
sudo apt-get install wmctrl xdotool
curl -LO https://github.com/jgm/pandoc/releases/download/3.1.11.1/pandoc-3.1.11.1-linux-amd64.tar.gz
tar xvzf pandoc-3.1.11.1-linux-amd64.tar.gz
sudo mv pandoc-3.1.11.1/bin/pandoc /usr/bin
Expand Down
28 changes: 26 additions & 2 deletions test/behave
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import os
import re
import shutil, shlex
import subprocess
import sys
import sys, time, threading
import tarfile
from pygit2 import Repository
import glob
Expand Down Expand Up @@ -71,7 +71,7 @@ parser.add_argument('--inspire-hep', '--no-inspire-hep', dest='inspireHEP', acti
parser.add_argument('--worker', '--no-worker', dest='worker', action=BooleanAction, default=False)
parser.add_argument('--logging', '--no-logging', dest='logging', action=BooleanAction, default=False)
parser.add_argument('--caching', '--no-caching', dest='caching', action=BooleanAction, default=True)
parser.add_argument('--headless', '--no-headless', dest='headless', action=BooleanAction, default=platform.system() == 'Linux')
parser.add_argument('--headless', '--no-headless', dest='headless', action=BooleanAction, default=platform.system() == 'Linux' and not os.getenv('XDG_SESSION_TYPE'))
parser.add_argument('--this', action='store_true')
parser.add_argument('--test-this', action='store_true')
parser.add_argument('--slow', action='store_true',
Expand Down Expand Up @@ -176,9 +176,33 @@ class InstallLastRunner(Runner):
if install: locations.append(install)
return locations

def cancel_proxy():
for i in range(20):
print('cancel-proxy: looking for proxy auth window')
result = subprocess.run(['wmctrl', '-l'], capture_output=True, text=True)
window_id = None
for line in result.stdout.splitlines():
if 'Authentication Required - Zotero' in line:
window_id = line.split()[0]
break

time.sleep(5)
if window_id:
print('cancel proxy:', window_id)
time.sleep(3)
subprocess.run(['xdotool', 'windowactivate', '--sync', window_id, 'key', 'Escape'])
return

print('cancel proxy: no window found')

def main():
config = Configuration()
thread = None
thread = threading.Thread(target=cancel_proxy)
thread.start()
sys.exit(run_behave(config, runner_class=InstallLastRunner))
if thread:
thread.join()

if args.headless:
from xvfbwrapper import Xvfb
Expand Down

0 comments on commit 07c75bd

Please sign in to comment.