Replies: 6 comments 1 reply
-
Tests should never be deleted. They make sure that we catch regressions and they need to be executed every time a PR is requested. It seems we already are "scratching" the netlify CI time limits. The slowest and probably memory consuming elements is creating the TW static html pages, which are also created every time a PR is requested. |
Beta Was this translation helpful? Give feedback.
-
I should clarify - when I say "the Playwright-based tests could be deleted", I mean any new Playwright-based tests meant to make sure regressions don't creep in while refactoring the boot process is happening, and only once other, faster tests are written to cover the boot process. |
Beta Was this translation helpful? Give feedback.
-
I am not really sure what you mean by boot related code. The core repo has a boot.js and a bootprefix.js. Do you mean those or do you mean when the wiki gets started. Boot*.js does mainly instantiate the different modules by loading them from files or from tiddlers. So we do not test the boot functions but the module functions once they are initialised. If they are available boring did work. |
Beta Was this translation helpful? Give feedback.
-
Ok, let me provide a more concrete example - here's a PR I submitted a few weeks ago: #9025 I'd found a bug where using What I'm proposing above would be to refactor |
Beta Was this translation helpful? Give feedback.
-
Another thing that comes to mind - I know that historically, TiddlyWiki has been hesitant to use third-party dependencies, but I was wondering if others would be open to leveraging modules like mock-fs for things like the |
Beta Was this translation helpful? Give feedback.
-
Here's an example of what I have in mind for these kinds of tests: https://github.com/hoelzro/TiddlyWiki5/tree/example-e2e-test/full-wiki-tests/plugin-derived-fields I'm not sure about how we'd want to structure these tests and run them in CI, and we'd probably want to use JavaScript rather than shell to actually drive tests, but the basic idea is to set up full wikis demonstrating the behavior under test and run each of their |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For the last two changes I've made to TiddlyWiki, I've wanted to add tests, but they've been in two parts of the code (namely, the plugin-loading part of the boot process and the menubar plugin) that don't seem to have testing infrastructure set up.
At @Jermolene's suggestion, I'd like to start a discussion about testing TiddlyWiki, specifically:
Which parts are and are not covered by tests?
As far as "covered" goes, widgets, parsing, and filters seem to be tested.
The boot process and plugins are my own immediate examples of things that are not covered, but I'd like to identify others.
How do we test these parts?
For the plugin-loading code, @Jermolene suggested a refactor, but undertaking a refactor without tests makes me nervous, so I have a bit of a dilemma 😅
I was thinking that maybe some sort of roundtrip/end-to-end testing could be done to provide some assurance during a refactor - the idea here would be to build entire wikis for test cases, and leverage Playwright to check for regressions. These would be slow, but as chunks of functionality get covered by more unit-style tests after some refactoring, the Playwright-based tests could be deleted.
Beta Was this translation helpful? Give feedback.
All reactions