Skip to content

Commit 26ae499

Browse files
ci: github workflows and pytest issue (#1373)
* fix: if docs do not change, do not fail ci * fix: roll back change that is not 3.8 specific * fix: delete non cleaned up test dirs
1 parent 8fbf39e commit 26ae499

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464
git config --global user.email '[email protected]'
6565
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
6666
git commit -am "$last_commit"
67-
git push
67+
git diff --quiet @{u} HEAD || git push

.github/workflows/test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ jobs:
106106
run: | # we need a separate step because of the bash-specific if-statement in the previous one.
107107
pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1
108108
- name: Check for files left behind by test
109-
# skip 3.8 as it fails only for Python 3.8 for no explainable reason.
110-
if: matrix.os != 'windows-latest' && matrix.python-version != '3.8' && always()
109+
if: matrix.os != 'windows-latest' && always()
111110
run: |
112111
before="${{ steps.status-before.outputs.BEFORE }}"
113112
after="$(git status --porcelain -b)"

tests/conftest.py

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import logging
2727
import os
28+
import shutil
2829
from pathlib import Path
2930
import pytest
3031

@@ -164,6 +165,15 @@ def pytest_sessionfinish() -> None:
164165
# Local file deletion
165166
new_file_list = read_file_list()
166167
compare_delete_files(file_list, new_file_list)
168+
169+
# Delete any test dirs that remain
170+
# In edge cases due to a mixture of pytest parametrization and oslo concurrency,
171+
# some file lock are created after leaving the test. This removes these files!
172+
test_files_dir=Path(__file__).parent.parent / "openml"
173+
for f in test_files_dir.glob("tests.*"):
174+
if f.is_dir():
175+
shutil.rmtree(f)
176+
167177
logger.info("Local files deleted")
168178

169179
logger.info(f"{worker} is killed")

0 commit comments

Comments
 (0)