-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests and continuous integration: Fixed issues and updated CI configuration #4149
base: main
Are you sure you want to change the base?
Conversation
pyproject.toml
Outdated
python_files = [ | ||
"test/test*.py", | ||
"test/Test*.py", | ||
] | ||
python_classes = "Test" | ||
python_functions = "test" | ||
filterwarnings = [ | ||
"error", | ||
# note the use of single quote below to denote "raw" strings in TOML | ||
'ignore:tostring\(\) is deprecated. Use tobytes\(\) instead\.:DeprecationWarning:OpenGL', | ||
'ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only taken into account when running tests from source directory... so all test files not starting with test_
where skipped when running from silx.test.run_tests
....
Also raising errors on warnings was not enabled all the time.
test_module.run_tests( | ||
module=None, | ||
args=[normalize_option(p) for p in sys.argv[1:] if p != "--installed"], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use silx.test.run_tests
src/silx/test/__init__.py
Outdated
cmd = [ | ||
sys.executable, | ||
"-m", | ||
"pytest", | ||
f"--rootdir={silx.__path__[0]}", | ||
"--verbosity", | ||
str(verbosity), | ||
# Handle warning as errors unless explicitly skipped | ||
"-Werror", | ||
"-Wignore:tostring() is deprecated. Use tobytes() instead.:DeprecationWarning", | ||
"-Wignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning", | ||
] + list(args) | ||
|
||
if module is not None: | ||
# Retrieve folder for packages and file for modules | ||
imported_module = importlib.import_module(module) | ||
cmd.append( | ||
imported_module.__path__[0] | ||
if hasattr(imported_module, "__path__") | ||
else imported_module.__file__ | ||
) | ||
|
||
return subprocess.run(cmd, check=False).returncode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_tests.py
now uses this function.
It should be the only way to start silx tests to make sure to use consistent config
if qt.BINDING == "PySide6": | ||
# PySide has no qWait, provide a replacement | ||
timeout = int(ms) | ||
endTimeMS = int(time.time() * 1000) + timeout | ||
qapp = qt.QApplication.instance() | ||
while timeout > 0: | ||
qapp.processEvents(qt.QEventLoop.AllEvents, timeout) | ||
timeout = endTimeMS - int(time.time() * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With PySide6, QTest.qWait exists...
""" | ||
|
||
class _Signals(qt.QObject): | ||
class Signal(qt.QObject): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworking the signaling from thread to avoid a segmentation fault
.github/workflows/ci.yml
Outdated
if [ ${{ runner.os }} == 'Windows' ]; then | ||
export WITH_GL_TEST=False | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable OpenGL tests on Windows for now: some of the tests fails and this needs more investigation...
8d3e670
to
252045f
Compare
for all test file names
3f9f1d0
to
960610f
Compare
Checklist:
<Module or Topic>: <Action> <Summary>
(see contributing guidelines)This PR aims at fixing tests errors/seg fault occuring in CI.
It does not fix all randomly occuring errors. For example, errors due to
os.unlink
failing because a file is accessed by another process under Windows are not fixed.It also updates the CI configuration, mainly to also run GUI tests on Windows with github actions (without the tests that require OpenGL for now).