Skip to content
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

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Jul 12, 2024

Checklist:


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).

@t20100 t20100 added this to the Next release milestone Jul 12, 2024
pyproject.toml Outdated
Comment on lines 16 to 28
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',
]
Copy link
Member Author

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.

Comment on lines +175 to +178
test_module.run_tests(
module=None,
args=[normalize_option(p) for p in sys.argv[1:] if p != "--installed"],
)
Copy link
Member Author

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

Comment on lines 59 to 83
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
Copy link
Member Author

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

Comment on lines -327 to -334
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)
Copy link
Member Author

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):
Copy link
Member Author

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

Comment on lines 151 to 153
if [ ${{ runner.os }} == 'Windows' ]; then
export WITH_GL_TEST=False
fi
Copy link
Member Author

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...

@t20100 t20100 force-pushed the ci-windows branch 3 times, most recently from 8d3e670 to 252045f Compare August 29, 2024 11:58
@t20100 t20100 force-pushed the ci-windows branch 2 times, most recently from 3f9f1d0 to 960610f Compare August 30, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant