-
Notifications
You must be signed in to change notification settings - Fork 913
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
ENH: The alerts package #2646
ENH: The alerts package #2646
Conversation
- MasterLog no longer stores alerts, but creates alert logs, although folder needs a location - Changes to yaml catalogue keys
…ychopy into globalErrorHandling
Pathlib is in the Python 3.4 standard library after PEP 428 acceptance. It needs installing for Python 3.3 or older.
Should fail for Python 2 until pathlib is set as a dependency
This tidies up the component modules
This enables the master log to be created in each project folder. Also reformats the alert messages to include component name and type, with relevant checks. This provides more useful messages.
The timing test currently only tests whether the start time occurs after the end time of the component. Includes relevant checks for size and position attributes, and catches for errors that occur when evaluating a string containing a variable. Currently, parameters containing variables cannot be tested because the value of the variable is unknown.
Also sends output file of psyexpCompile test to temp directory.
Passes locally, but may fail on Travis
This enables catalogue messages to be formatted so they are more informative. Also refactors catalogue as fewer entries are required because of the new ability to format messages.
Now, code component syntax is tested for Python and JS each time a script is compiled. Any errors are allowed to pass but alerts are formatted with informative information, such as which tab contains the error. The information is sent to the stdoutFrame and saved in the alerts log folder. Also adds string formatting values to the size, position and time checks, checks time values can be tested correctly.
- Adds test for disabled components - Renames alert module - Alert module no longer has log classes, instead alerts are called using the alert function. - Adds error handler for receiving errors from the error stream - In progress alert dialog created as a target for alerts. This will be a panel added to the Project Info dialog - Integrity check added to psyexpCompile - Tests adapted to new alert system
- Alerts from errorhandler now show in ProjectInfo each time it opens - Alerts now stored in separate list from errors in ErrorHandler - removes alerts generated when tests fail due to variable use - renames receiveWarning method in ErrorHandler to receiveAlert
- AlertLog container created to feed alert panel - Removes setting of stderr, can be done using Builders setStandardStream - Stores original stderr in app, as with stdout - Corrects Builder subprocess to write to stream, rather than variable
The error handler is flushed when it writes errors, so calls to write interrupt the reporting of Alerts. The current solution is to change calls to write from error stream to logging module, and this preservers alerts. There were also issues with capturing the error stream, solved here.
Syntax checks would not pass because the Param needed to pass the value to the compile function.
For now, we only need to capture the error stream for the error handler. The output of its prints are directed to the stdout, so for seeing warnings it only matters where that is pointing to. In future, it may be good to send outputs and errors to the runner frame only, one source for all information.
@peircej , apart from the travis error, this pull request passes. |
Codecov Report
@@ Coverage Diff @@
## master #2646 +/- ##
==========================================
- Coverage 44.28% 43.99% -0.29%
==========================================
Files 234 241 +7
Lines 42153 44600 +2447
Branches 7286 7589 +303
==========================================
+ Hits 18666 19622 +956
- Misses 21501 22969 +1468
- Partials 1986 2009 +23
Continue to review full report at Codecov.
|
This pull request introduces 3 alerts and fixes 1 when merging bb017ce into 8db8521 - view on LGTM.com new alerts:
fixed alerts:
|
Including AlertLog now iterable and indexable
They were in place for future, will use when needed.
This pull request introduces 1 alert and fixes 1 when merging 7bbaf75 into c63332a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request fixes 1 alert when merging 2f3e5a3 into bb5e637 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging cebe934 into bb5e637 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging af02af5 into e937f5a - view on LGTM.com fixed alerts:
|
Main change is the use of separate alert files for each alert. Alert files support restructured text for implementation in web help pages Includes alertCategories list as yaml.
This pull request introduces 2 alerts and fixes 1 when merging 695339a into 81fb15f - view on LGTM.com new alerts:
fixed alerts:
|
Also refactored tests.
This pull request fixes 1 alert when merging 6202191 into 81fb15f - view on LGTM.com fixed alerts:
|
receiveAlert
method in ErrorHandler, which should be on the standard error stream.alerts
attributealerts
list to thealertLog
container in the_alerts
module.alertLog
is used to populate the new alert panel