[Test Enhancements] Debug_Print needs a fail-safe. #15

Closed
opened 2019-10-04 23:06:11 +00:00 by ZAdamMac · 1 comment
ZAdamMac commented 2019-10-04 23:06:11 +00:00 (Migrated from github.com)

Is your feature request related to a problem? Please describe.
Tapestry's debug_print() function relies upon a global variable, state, which I believe is the master NS reference. This works as intended during runtime, but causes failures during testing under the test-enhance model.

Describe the solution you'd like
Add exception handling to catch the relevant NameError when debug_print() is called outside of its usual context, which will cause the function to simply pass.

Describe alternatives you've considered
Alternatives were to wrap tests known to trigger debug print as child process tasks but this seems to be the far more complex path and introduces performance issues in testing.

Additional context
A one-off test version of Tapestry was packaged with this change and it did not negatively impact performance during normal operation and allowed the new positive_tests package (currently on test-enhance) to complete. The changes were reverted and are not currently committed.

**Is your feature request related to a problem? Please describe.** Tapestry's debug_print() function relies upon a global variable, state, which I believe is the master NS reference. This works as intended during runtime, but causes failures during testing under the test-enhance model. **Describe the solution you'd like** Add exception handling to catch the relevant NameError when debug_print() is called outside of its usual context, which will cause the function to simply pass. **Describe alternatives you've considered** Alternatives were to wrap tests known to trigger debug print as child process tasks but this seems to be the far more complex path and introduces performance issues in testing. **Additional context** A one-off test version of Tapestry was packaged with this change and it did not negatively impact performance during normal operation and allowed the new positive_tests package (currently on test-enhance) to complete. The changes were reverted and are not currently committed.
ZAdamMac commented 2019-10-09 01:58:01 +00:00 (Migrated from github.com)

Code that fixes this issue is tested and validated. Because the branch it was fixed in is not yet ready for a move to master, and this issue is not a runtime issue, the 2.0.2 release will be delayed until the release of the full test-enhance branch.

Code that fixes this issue is tested and validated. Because the branch it was fixed in is not yet ready for a move to master, and this issue is not a runtime issue, the 2.0.2 release will be delayed until the release of the full test-enhance branch.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zadammac/Tapestry#15
No description provided.