Project Plan and Work Flow
This page contains the project plans and the work flow for the GSoC project pkumar_pytest-2.
Improve moin2 unit-tests / unit-testing framework
Hint: maybe use reST markup and try to write like documentation, maybe we can re-use some stuff in the moin2 docs then (sphinx uses reST also)
As this pad is common for both unittest GSOC projects, we'll need to split the tasks between the 2 students PK and HA.
Rewrite tests to use saner strategy
E.g.:
- string compares vs. XPath - please discuss and come to an agreement on mentor level before coding phase starts!
- overcomplicated tests (sometimes simpler might be better)
- read the tests, get a understanding what they do test (and what they should test), fix as needed
- definition what the tests should be able to catch
... (add much more details) ...
flask-testing extension
Look at it, do we want to use it? This is unittest, not pytest. can be done with funcargs
Improve test coverage
(see conftest.py about how to enable coverage)
... (add much more details) ...
Remove artificial setup / tweaking
(some tests do much tweaking to setup their environment so they can run - sometimes this is done in a rather artificial/hackish way. it should be rather like the test code running as it was application code and the environment rather be setup like when moin processes a normal request)
... (add much more details) ...
fix memory leaking
some leaks might be due to the code that is tested, but some might also be due to test infrastructure. See conftest.py.
... (add much more details) ...
fix failing imports
some tests error out due to failing imports maybe (not sure, but e.g. sphinx docs generation has this issue. e.g. if python-ldap or openid stuff is not installed)
... (add much more details) ...
test_sourcecode / pep8 testing
we have a custom / home grown test_sourcecode, iirc py.test2 has a plugin for pep8 checking -- can we replace ours by it without losing important functionality?
also, it would be nice to have not only python code tested, but also some basic tests for other files, like: - *.html, *.css, *.js - *.po
tests for these could:
- make sure there are lf-only line endings
- make sure there are no TABs
- make sure there are is no trailing whitespace at EOLs / EOF
... (add much more details) ...
- Writing New Tests
- Improving Test Coverage
- Framework improvement
Not testing stuff that is not ours
Make the framework so it only tests stuff in MoinMoin/, not in e.g. env/.
The directories it scans by default should be configurable, in case we have some more toplevel packages than MoinMoin some day.
py.test2
Currently our tests require py.test 1.3.4, but in future they should run on py.test2. The py.test version used for the project will be py.test 2.0.3 (release is available from pypi).
... (add much more details) ...
Common plan for the GSoC project 'pytest-2'
[Complete list of modules(in order of their size)]
[pattern followed]
- Module name - code KB : tests KB
Modules with no tests:
- signalling [PK] - 1.4 KB : 0 KB
- script [PK] - 17.9 KB : 0 KB
- i18n [HA] - 2.1 KB : 0 KB
Modules with tests:
- mail [HA] - 8.4 KB : 4.6 KB
- themes [PK] - 13.9 KB : 1.4 KB
- macro [HA] - 14.5 KB : 1.3 KB
- security [HA] - 22 KB : 17.5 KB
- datastruct [HA] - 28 KB : 19.6 KB
- config [PK] - 28.8 KB : 1.4 KB
- auth [HA] - 43.6 KB : 8.4 KB
- items [HA] - 56.4 KB : 5.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- apps [PK] - 75.2 KB : 8.8 KB
- util [PK] - 188.1 KB : 73.1 KB
- storage [HA] - 299.3 KB : 81.6 KB
- converter [PK] - 323 KB : 198.2 KB
Modules with no python code:
- static
- templates
- translations
- i18n
[May 23 - May 31]: (Porting + Bug Listing) Week
This week is for the porting of current tests to py.test2.
Only port, DO NOT CHANGE ANYTHING NOT NEEDED FOR PORTING. You MUST note the number of test fails, skips, succeeds, etc. of the module before and after porting and the numbers MUST match. If they do not match, you broke something while porting.
If you notice places for improvements in the tests, bugs, whatever - report an issue about it, but do not fix it now.
[Modules to be completed by PK]
- signalling [PK] - 1.4 KB : 0 KB
- script [PK] - 17.9 KB : 0 KB
- themes [PK] - 13.9 KB : 1.4 KB
- config [PK] - 28.8 KB : 1.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- apps [PK] - 75.2 KB : 8.8 KB
- util [PK] - 188.1 KB : 73.1 KB
- converter [PK] - 323 KB : 198.2 KB
[Modules to be completed by HA]
- i18n[no tests] - 2.1 KB : 0 KB
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
[June 1 - June 9]: Bug Week
This week is for the already reported issues like:
- Leaking problem of current tests
- File leak issue with fs2
- Logging for tests
[Issues to be worked on by PK]
- Logging for tests
[Issues to be worked on by HA]
- Leaking problem of current tests.
[June 10 - June 17]: Bug Week(Reloaded)
This week is for the newly created issues, if any due to porting and also for the other major and minor bugs.
[Issues to be worked on by PK]
- File leak issue with fs2
- Reduce the number of calls for app resulting in faster tests
[Issues to be worked on by HA]
- Memory leak problem.
- Using 'Dozer' for memory leak problem.
[June 18 - June 25] Improvement of the state of MoinMoin tests
- Decrease the complexity of test codes and its infrastructure.
- Rewrite few tests which fulfils the same purpose, but in a more
- effecient way.
- Making the test codes more automated and their behavior more
- pythonic.
- Sanitsing code of the modules which either skip, or fail.
[Modules to be implemented by PK]
- signalling [PK] - 1.4 KB : 0 KB
- script [PK] - 17.9 KB : 0 KB
- themes [PK] - 13.9 KB : 1.4 KB
- config [PK] - 28.8 KB : 1.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- apps [PK] - 75.2 KB : 8.8 KB
- util [PK] - 188.1 KB : 73.1 KB
- converter [PK] - 323 KB : 198.2 KB
[Modules to be implemented by HA]
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
TODO List of the Week:
- A detailed tutorial of the job done so far, before mid-term evaluation.
[June 26 - June 30] Improvement of MoinMoin Tests continued...
[Modules to be implemented by PK]
- signalling [PK] - 1.4 KB : 0 KB
- script [PK] - 17.9 KB : 0 KB
- themes [PK] - 13.9 KB : 1.4 KB
- config [PK] - 28.8 KB : 1.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- apps [PK] - 75.2 KB : 8.8 KB
- util [PK] - 188.1 KB : 73.1 KB
- converter [PK] - 323 KB : 198.2 KB
[Modules to be implemented by HA]
//Need to add modules
Division of Test improvement work:
1. Add/modify tests to existing test files. 2. Add new tests for the files which don't have any test.
[July 1 - July 7] Working on 1st part of the above task:
[Modules to be implemented by PK]
- signalling [PK] - 1.4 KB : 0 KB
- script [PK] - 17.9 KB : 0 KB
- themes [PK] - 13.9 KB : 1.4 KB
- config [PK] - 28.8 KB : 1.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- apps [PK] - 75.2 KB : 8.8 KB
- util [PK] - 188.1 KB : 73.1 KB
- converter [PK] - 323 KB : 198.2 KB
[Modules to be implemented by HA]
- i18n[no tests] - 2.1 KB : 0 KB
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
[July 8 - July 17] Working on Test improvement
Working on 1st part of above task:
[Modules to be implemented by PK]
- converter [PK] - 323 KB : 198.2 KB
- apps [PK] - 75.2 KB : 8.8 KB
- themes [PK] - 13.9 KB : 1.4 KB
MoinMoin [PK] - 63 KB : 109.5 KB
- config [PK] - 28.8 KB : 1.4 KB
Working on 2nd part of above task:
- util [PK] - 188.1 KB : 73.1 KB
[Modules to be implemented by HA]
Working on 1st part of above task:
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
Working on 2nd part of above task:
- i18n[no tests] - 2.1 KB : 0 KB
[July 20 - July 25] Fixing storage module
This task includes fixing errors and failures in storage module
[July 26 - August 1] Improvement of Test coverage
Working on 1st part of above task.
[Modules to be implemented]
- i18n[no tests] - 2.1 KB : 0 KB
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
[August 2 - August 10] Improvement of Test coverage
Working on 2nd part of above task.
[Modules to be implemented]
- i18n[no tests] - 2.1 KB : 0 KB
- mail - 8.4 KB : 4.6 KB
- macro - 14.5 KB : 1.3 KB
- security - 22 KB : 17.5 KB
- datastruct - 28 KB : 19.6 KB
- auth - 43.6 KB : 8.4 KB
- items - 56.4 KB : 5.4 KB
- storage - 299.3 KB : 81.6 KB
[August 11 - August 16] Test cleanup
Cleaning up the tests
[August 17 - August 22] Final Corrections
Task for this week includes the following:
Bringing MoinMoin tests in sync with codes from different GSoC students' repos.
- Final code cleanups
- Documentations