On Sunday, November 29, 2020 at 4:31:42 AM UTC-6 Edward K. Ream wrote: *tl;dr: *It will be *straightforward *to provide complete coverage tests > for most of Leo! >
The various Ahas have straightforward consequences: Leo will continue to support @test and @suite nodes. Eventually, leoTest.py will contain only the minimum code to support *generic* @test and @suite nodes. Considerable code will migrate from leoTest.py to leoTest2.py. leoTest2.py will also contain new code and classes. As before, most of Leo's unit tests must be aware of Leo's DOM and API. To make that happen, leoTest2.py will define test classes that define off-screen *test commanders*. leoTest.py already does this. The corresponding code in leoTest2.py should be substantially simpler because the code will not be running *inside *Leo. Oh joy. The distinction between running unit tests internally or externally will disappear. leoTest2.py must provide a way of running all unit tests. It will likely do that by looking for source files with a top-level "pytest_main" method. 20+ years of hindsight should improve leoTest2.py. For example, it's now clear that most unit tests can and should be run with a "null" (string-based) gui. leoTest2.py must also support desperately needed unit tests of the Qt gui. I'll be experimenting with running tests in an "off-screen" Qt gui. Let me emphasize several points: 1. The conversion script <https://github.com/leo-editor/leo-editor/issues/1758#issuecomment-735367166> is dead simple, both in concept and in code. The script extracts data from a tree of nodes copied from unitTest.py, and uses that data as kwargs to a "run_test" method of a test class. Neither the run_test method nor the test class exists at present, but that's a nit :-) I'll adapt that script to convert other @test nodes in unitTest.py. Other @test nodes can just be copied to their own unit tests. Aside: The new unit tests will not have automatic access to c and g and p. However, that won't change much, because the various setup and teardown methods can compensate. Surely, it's no big deal. 2. The sabbatical will continue. The main focus of my sabbatical remains learning new web technologies. But now a secondary focus will be to revolutionize Leo's unit tests. In the next few weeks, I *will *create leoTest2.py and create new unit tests covering most of Leo's commands. PR 1759 <https://github.com/leo-editor/leo-editor/pull/1759> tells which files were changed. To that list I'll add files changed in the ekr-undo9 branch. Other work can wait. I am not going to commit to covering all of Leo's source code immediately. Some unit tests can wait. Otoh, full coverage testing of Leo's code base will be a defining feature of Leo 6.4. *Summary* No new significant invention is needed to make full coverage testing of Leo's code base a reality. The sabbatical will continue, now with twin objectives. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/0c87a970-e16e-45be-9244-50fc8e2a012en%40googlegroups.com.
