Xqt submitted this change.

View Change

Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
GH tests: finally close socket in GitHub workflows

Change-Id: I8ae9de1f11dffa123dccf3edb469f5fff4fcbe29
---
M .github/workflows/doctest.yml
M .github/workflows/login_tests-ci.yml
M .github/workflows/oauth_tests-ci.yml
M .github/workflows/pywikibot-ci.yml
4 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
index 1d71ba2..a3df52e 100644
--- a/.github/workflows/doctest.yml
+++ b/.github/workflows/doctest.yml
@@ -84,9 +84,15 @@
coverage run -m pytest pywikibot --doctest-modules --ignore-glob="*gui.py" --ignore-glob="*memento.py" --doctest-wait
- name: Close WMCS SOCKS tunnel
if: always()
+ shell: bash
run: |-
if [ -f ssh.pid ]; then
- kill "$(cat ssh.pid)" || true
+ PID=$(cat ssh.pid)
+ kill "$PID" || true
+ echo "SSH tunnel closed (PID $PID)"
+ rm -f ssh.pid
+ else
+ echo "No SSH tunnel PID found"
fi
- name: Show coverage statistics
run: |
diff --git a/.github/workflows/login_tests-ci.yml b/.github/workflows/login_tests-ci.yml
index 7edffb7..8edfcb1 100644
--- a/.github/workflows/login_tests-ci.yml
+++ b/.github/workflows/login_tests-ci.yml
@@ -148,6 +148,18 @@
run: |
python pwb.py version
coverage run -m unittest -vv tests/site_login_logout_tests.py
+ - name: Close WMCS SOCKS tunnel
+ if: always()
+ shell: bash
+ run: |-
+ if [ -f ssh.pid ]; then
+ PID=$(cat ssh.pid)
+ kill "$PID" || true
+ echo "SSH tunnel closed (PID $PID)"
+ rm -f ssh.pid
+ else
+ echo "No SSH tunnel PID found"
+ fi
- name: Show coverage statistics
run: |
coverage combine || true
diff --git a/.github/workflows/oauth_tests-ci.yml b/.github/workflows/oauth_tests-ci.yml
index 03f427e..3d4c180 100644
--- a/.github/workflows/oauth_tests-ci.yml
+++ b/.github/workflows/oauth_tests-ci.yml
@@ -137,6 +137,18 @@
run: |
python pwb.py version
coverage run -m unittest -vv
+ - name: Close WMCS SOCKS tunnel
+ if: always()
+ shell: bash
+ run: |-
+ if [ -f ssh.pid ]; then
+ PID=$(cat ssh.pid)
+ kill "$PID" || true
+ echo "SSH tunnel closed (PID $PID)"
+ rm -f ssh.pid
+ else
+ echo "No SSH tunnel PID found"
+ fi
- name: Show coverage statistics
run: |
coverage combine || true
diff --git a/.github/workflows/pywikibot-ci.yml b/.github/workflows/pywikibot-ci.yml
index c348a7b..6fc8c64 100644
--- a/.github/workflows/pywikibot-ci.yml
+++ b/.github/workflows/pywikibot-ci.yml
@@ -159,6 +159,18 @@
else
coverage run -m pytest
fi
+ - name: Close WMCS SOCKS tunnel
+ if: always()
+ shell: bash
+ run: |-
+ if [ -f ssh.pid ]; then
+ PID=$(cat ssh.pid)
+ kill "$PID" || true
+ echo "SSH tunnel closed (PID $PID)"
+ rm -f ssh.pid
+ else
+ echo "No SSH tunnel PID found"
+ fi
- name: Show coverage statistics
run: |
coverage combine || true

To view, visit change 1295541. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8ae9de1f11dffa123dccf3edb469f5fff4fcbe29
Gerrit-Change-Number: 1295541
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot