Changes

Jump to: navigation, search

Testing Gramps

2,063 bytes added, 00:56, 29 March 2022
m
add-on > addon ( stick with one spelling )
=Test Automation=
Since 2022 we have test automation on [https://github.com/gramps-project/gramps/actions/workflows/gramps-ci.yml?query=branch%3Amaster GitHub Actions]. Status of all branches is [https://github.com/gramps-project/gramps/actions/workflows/gramps-ci.yml here].
 
GitHub Actions configuration is in [https://github.com/gramps-project/gramps/blob/master/.github/workflows/gramps-ci.yml .gramps-ci.yml].
 
What tests does GitHub Actions run? This is determined by the script line in [https://github.com/gramps-project/gramps/blob/master/.github/workflows/gramps-ci.yml .gramps-ci.yml].
nosetest3 runs all modules or folders named *[Tt]est.
 
* [https://docs.github.com/en/actions GitHub Actions Documentation]
 
=Test status=
We currently As of Jan 2015 we don't have a record of tests executed, the platforms and environments they were run upon, and what code they covered. The only indirect evidence is available in open bugs, when people care to fill in these details. :-(
==Possible improvements==
* Unify running all the tests, in- or out- tree
** Try switching the feature tests and non-automated unit tests in test/ from our runner scripts to [httphttps://docs.python.org/2/library/unittest.html#test-discovery python native unittest discovery mechanism]. ** We have a stale [httphttps://sourceforgegithub.netcom/pgramps-project/gramps/source/ciblob/master/tree/gramps/test/regrtest.py gramps/test/regrtest.py] runner, notable for logging init. - should we revive that, or maybe integrate into setup.py test runner?* [https://wiki.python.org/moin/CodeCoverage| Coverage analysis]* [http://docs.python-guide.org/en/latest/scenarios/ci/ Continuous ] test status report, coverage, automatic deployment into win/mac/linux VMs (needs server capacity to be hosted online)(I can dream, can't I?){{bug|8294}}
* Automated regression tests for our GUI. The following links look interesting:
** [https://wiki.python.org/moin/PythonTestingToolsTaxonomy#GUI_Testing_Tools Python Wiki:GUI Testing Tools]** [http://unpythonic.blogspot.co.il/2007/03/unit-testing-pygtk.htmlUnit Testing PyGTK]** [http://ldtp.freedesktop.org/wiki/Cross Platform GUI Test Automation tool] =Tests and frameworks used=== Manual test plan ==See [https://github.com/gramps-project/gramps/blob/master/TestPlan.txt TestPlan.txt] in gramps toplevel. (I believe this is only done at a major release). == Specialized scripts for testing ==See more specialized scripts in [https://github.com/gramps-project/gramps/tree/master/test test/], status unknown.
Contents of [https://github.com/gramps-project/gramps/tree/master/test test/] :
* GrampsLogger/
** ErrorReportAssistant_Test.py
** GtkHandler_Test.py
* LosHawlos_bsddbtest.py
* LosHawlos_dbtest.py
* RunAllTests.py
* dates.sh
* det_ancestor_report.sh
* det_descendant_report.sh
* impex.sh
* runtest.sh
* tools.sh
=Currently used tests and frameworks=== testing of reports ======= test/runtest.sh ====
'''[httphttps://sourceforgegithub.netcom/pgramps-project/gramps/source/ciblob/master/tree/test/runtest.sh test/runtest.sh]''' - Report test for Gramps: Generate every report in every format. Runs all possible reports using the report cli interface, based on the [[example.gramps ]] database. This test is not fully self-contained, in that it depends on various environment settings, such as your locale, your preferred name display formats, and your report options. Last, but not the least, the verification of the resulting reports is entirely manual.
Bugs tagged as [http://www.gramps-project.org/bugs/search.php?tag_string=found-by-runtest.sh found-by-runtest.sh]
== other report testing ==See more specialized scripts in test/, status unknown. ==test/impex.sh==='''[httphttps://sourceforgegithub.netcom/pgramps-project/gramps/source/ciblob/master/tree/test/impex.sh test/impex.sh]''' - Import/export test for Gramps.
From the file header:
== Unit testing ==
=== test/RunAllTests.py ===
'''[httphttps://sourceforgegithub.netcom/pgramps-project/gramps/source/ciblob/master/tree/test/RunAllTests.py test/RunAllTests.py]''' - Testing framework for performing a variety of unittests for Gramps. Runs out-of-tree (not in gramps/) testing code, by looking for any test/*_Test.py files and executing the test suites therein. See the current code in test/*_Test.py for example and python standard unittest docs.
{{man note|Starting with gramps40 gramps4.x branch, |these tests include non-automated unit tests only. The automated unit tests are all under gramps/.}}
Bugs tagged as [http://www.gramps-project.org/bugs/search.php?tag_string=found-by-RunAllTests.py found-by-RunAllTests.py]
{{man warn|GtkHandler testing code pops up the Gramps error dialog, |but this is actually for testing the error reporting itself. Don't be scared by the dialog, it's expected. Your manual work is required to close the dialogs with the "Cancel" button. The relevant tests still pass (unless there's another bug there)...}}
=== unit tests in the main tree ===
python setup.py test
See [[Unit Test Quickstart]] for detailed running instructions.
==== using - python setup.py test ==== python setup.py test {| {{prettytable}}class="wikitable sortable"
! File
! Test
|8
|bgcolor="#80ff80"| OK
|(6 test require [[Unit_Test_Quickstart#Mocking_external_dependencies_with_unittest.mock| mocking ]] to run)
|-
|gramps/gen/test/config_test.py
|-
|}
 
{{man note|Note from Nick Hall|Some of the merge tests are slow because they actually run Gramps from the command line to import and export files.<br><br>Extra packages and addons are required to run some of the tests. From memory, you will need the
* Gramps addons
** CliMerge
** ExportRaw
*and the python packages.
** libxml2
** libxslt
** mocking
}}
 
==== semi-interactive ====
There is also semi-interactive testing via __main__ in some code:
{| {{prettytable}}class="wikitable sortable"
! File
! Status
! Comments
|-
|[https://github.com/gramps-project/gramps/tree/master/gramps/gen/relationship.py#l1889 gramps/gen/relationship.py]
|bgcolor="#ff8080"| To Do
|Relationship calculator
|-
|}
 
== Manual test plan ==
See [http://sourceforge.net/p/gramps/source/ci/master/tree/TestPlan.txt TestPlan.txt] in gramps toplevel. (I believe this is only done at a major release (like 4.0.0)).
=See also=
* [[Unit Test Quickstart]]
* [[Test_date_handlers#TO_CHECK]]
* [[Gramps_Performance#The_Test_Results]]
* [[Test Imports module]]
[[Category:Developers/Reference]]
[[Category:Developers/Quality Assurance]]

Navigation menu