-
Notifications
You must be signed in to change notification settings - Fork 28
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
refactor incremental tests #434
Conversation
Thank you for taking care of this! Only noteworthy change I noticed is in a custom widget of mine (see below), where I just pass a single Node as
It is easily fixed doing a |
@@ -58,6 +58,11 @@ def __eq__(self, other): | |||
if self.NODE_TYPE == NODE_TYPE.TEXT_NODE: | |||
return self._string == other._string | |||
|
|||
# widgets | |||
# TODO: remove in 2.0 |
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.
Maybe issue a deprecation warning?
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.
Until now we did not issue deprecation warnings but added wrote them to the documentation. It's a good idea to deprecate the Legacy Widget API now, but I think it's a little bit much for this PR because the old API gets used in multiple examples in the documentation. I opened #437 as a base for a follow-up PR.
assert TestWidget(Div()) == TestWidget(Div()) | ||
assert TestWidget(Div()) != TestWidget(Span()) | ||
|
||
assert TestWidget(foo=1) == TestWidget(foo=1) |
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.
I think that this test can be split into multiple ones.
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.
Good idea. Done!
Previously, the tests were designed to be incremental so failing tests in low-level components would cancel higher level tests. This way, a failing low-level test would not result in an all-red test-suite where the actual issue is hard to find. This behavior can be achieved much simpler, by ordering all tests from low-level to high-level and stopping at the first error. This patch removes all old infrastructure which implemented the incremental tests, and orders the tests from low-level to high-level, by using numeric file prefixes. After this patch the test-suite has the following stages: 00xx Testsuite tests 01xx HTML Datastructure Tests 02xx HTML API Tests 03xx Basic IO and Rendering Tests 04xx HTML API Browser Tests xxxx Misc Signed-off-by: Florian Scherf <[email protected]>
Signed-off-by: Florian Scherf <[email protected]>
client2 does not support `lona.html.Widget` and previously it would crash if it attempted to render widget nodes. Signed-off-by: Florian Scherf <[email protected]>
Signed-off-by: Florian Scherf <[email protected]>
Previously, `lona.html.Node.nodes` would only accept nodes and lists of nodes. This is unhandy when creating custom node classes and using `*args` and `**kwargs` since `*args` are tuples by default. This patch changes `lona.html.node_list.NodeList._reset()` to accept any kind of iterable. Signed-off-by: Florian Scherf <[email protected]>
Signed-off-by: Florian Scherf <[email protected]>
Previously, `lona.html.abstract_node.AbstractNode.__eq__()` would crash when one or both compared nodes where a widget. This patch fixes `lona.html.abstract_node.AbstractNode.__eq__()`, by adding proper compare logic for `lona.html.Widget`. Signed-off-by: Florian Scherf <[email protected]>
Signed-off-by: Florian Scherf <[email protected]>
b1b30f3
to
5f79f2a
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #434 +/- ##
==========================================
+ Coverage 71.30% 71.53% +0.23%
==========================================
Files 83 83
Lines 5697 5702 +5
Branches 1226 1072 -154
==========================================
+ Hits 4062 4079 +17
- Misses 1345 1349 +4
+ Partials 290 274 -16
☔ View full report in Codecov by Sentry. |
Oh! Thanks for reporting, that is not supposed to happen. I updated the patch and added two tests so this may not happen again. |
Jup, runs without issues now! |
@m-reichle: Great! Thanks for testing and reporting #433 in the first place! |
This PR refactors the incremental tests and fixes #433