This repository was archived by the owner on Mar 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Fix test suite #1114
Merged
Merged
Fix test suite #1114
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a fixture for launching TangoSchemeTest for a test
Parameterizable pytest test for setting models sequentially This is the Pytest equivalent to GenericWidgetTestCase.test10_SetModelsSequentially
Implement a context manager to facilitate checking deprecation errors in pytest tests
Leave only some relevant tests for quicker debugging of py35-qt5 testing issues
Re-enable test_form_itemFactory after refactoring it to use the qtbot fixture from pytest-qt
Refactor (to use qtbot) and re-enable the following: - test_form_itemFactory_selection - test_form_cwidget_bck_compat - test_form_itemFactory_loading
Try to avoid problems with tango in atexit() by forcing a previous unsubscribe in the test itself
- use cpascual conda forge (TEMPORARY) - set minimum version in tox.ini
py35-qt5 py36-qt5 py37-qt5 py37-ps2
This reverts commit abdf6ee.
This reverts commit f619202.
Use pytest-qt and parameterize. Also avoid segfaults in pyside2 tests due to PYSIDE-683 bug
The last refactoring introduced a failure in the last paramterization of test_TaurusValueCombobox. Try to fix it
The introduction of pytest-qt triggered several hidden issues in the PySide2 tests. Fix (or avoid) them
- Use pytest-qt - Skip if using PySide2 (to avoid segfault)
The taurus.external.qt.QtCore shim simply aliases pyqtProperty to Property when using the PySide2 binding. This produces segfaults during exit of tests if Property is called with the doc kwarg. Workaround by implementing pyqtProperty as a wrapper of Property that avoids passing the doc kwarg.
TaurusGui.loadConfiguration fails if the QApplication is not a TaurusApplication. This breaks the taurusgui test. Protect against this case
Reimplement using pytest and pytest-qt. The skipped tests are not ported.
Reimplement using pytest and pytest-qt.
Reimplement using pytest and pytest-qt.
Use pytest.mark.skipif instead of pytest.mark.skipIf
The *WidgetTestCase classes were created to help with Qt tests based on unittest. Since we moved all the Qt test to pytest-qt, we no longer want them (they are less robust and don't play well with the pytest-qt based tests) Mark them as deprecated and skip any test based on them.
Remove last usages of taurus.qt.qtgui.test.base in taurus code
TaurusLabel does not currently update its text when updating the format. Fix this by forcing a controllerUpdate() call whenever resetFormat is called. This was likely the cause of some of the fuzzyness in previous tests.
The "value" and "w_value" FgRoles do not raise deprecation warnings. Adapt the tests accordingly
The test_class_format is fuzzy because not always the format is reset (probably a race condition). Force an explicit format reset to avoid it.
For some reason, the check_taurus_deprecations context manager is not working ok when PySide2 is used via taurus.external.qt (maybe it has to do with the installed log manager?) As a workaround use xfail in these cases.
test_tauruslabel_text is not properly isolated and when it is called with FgRole="quality" it fails in PySide2 if it has been previously called with another FgRole. Workaround this by moving it to the first position.
Since python3.6 we get DeprecationWarning for invalid scape sequences. Fix them by marking the string literals as "raw"
Thread.isAlive was deprecated in 2.7 and is removed in 3.9/ Avoid it in our code
Since python3.3, Sequence and Mapping should be imported from collections.abc instead of from collections. Change code accordingly, keeping bck-compat for python2.7
Use logging.warning instead
Ensure file is closed.
43ecbde to
6cb42ff
Compare
AttributeTestCase.write_read_attribute() issues a pint warning. Refactor it to avoid unnecessary downcasting of Quantities to numpy arrays.
Usage of the VideoImageCodec raises the following deprecation warning in py3: "DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead" Replace fromstring -> frombuffer accordingly.
Ignore 3rd-party issued deprecation warnings and treat all warnings issued by taurus as errors (tests should fail if taurus emits a warning)
0cb35aa to
66e4d32
Compare
Member
Author
|
any @taurus-org/integrators daring to have a look at this PR? ;) |
|
Ok, for what is worth I did an overview and it LGTM. Also ran the tests locally (all except epics): Ran 565 tests in 6.247s The CI likes it also go for it! Do you press the button or should I? |
Member
Author
|
Thanks @tiagocoutinho !
do the honors yourself! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test suite is still too fuzzy, and the py35-qt5 target had to be quarantined.
This PR does a large refactoring of the tests (mostly the
taurus/qtones) to improve the situation. With it, the testsuite seems finally stable for all the targets. As a summary, here is what changed:Also, this PR removes the allowed-to-fail tests (python2 ones and flake8) from travis matrix (to avoid wasting time). They can be run locally and/or re-enabled at any moment