From 00e3963a96749e6406eb0908b034a228641bcebf Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Sun, 24 Jan 2010 20:40:12 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: f1c001048ccc36181a09a459327f563dbc26e12f Monotone-Revision: aab1e060a1d26a9624f7f84c30d1414ca1969560 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-01-24T20:40:12 Monotone-Branch: ca.inverse.sogo --- .mtn-ignore | 2 +- ChangeLog | 4 ++ Tests/Integration/README | 56 ++++++++++++++++++ Tests/{ => Integration}/all.py | 0 Tests/{ => Integration}/config.py.in | 0 Tests/{ => Integration}/preferences.py | 0 Tests/{ => Integration}/propfind.py | 0 .../test-caldav-scheduling.py | 0 Tests/{ => Integration}/test-config.py | 0 Tests/{ => Integration}/test-davacl.py | 0 Tests/{ => Integration}/test-ical.py | 0 Tests/{ => Integration}/test-maildav.py | 0 Tests/{ => Integration}/test-webdav.py | 0 Tests/{ => Integration}/test-webdavlib.py | 0 Tests/{ => Integration}/test-webdavsync.py | 0 Tests/{ => Integration}/utilities.py | 0 Tests/{ => Integration}/webdavlib.py | 0 Tests/README | 58 ++----------------- {UnitTests => Tests/Unit}/GNUmakefile | 0 {UnitTests => Tests/Unit}/SOGoTest.h | 0 {UnitTests => Tests/Unit}/SOGoTest.m | 0 {UnitTests => Tests/Unit}/SOGoTestRunner.h | 0 {UnitTests => Tests/Unit}/SOGoTestRunner.m | 0 .../Unit}/TestBSJSONAdditions.m | 0 {UnitTests => Tests/Unit}/sogo-tests.m | 0 25 files changed, 66 insertions(+), 54 deletions(-) create mode 100644 Tests/Integration/README rename Tests/{ => Integration}/all.py (100%) rename Tests/{ => Integration}/config.py.in (100%) rename Tests/{ => Integration}/preferences.py (100%) rename Tests/{ => Integration}/propfind.py (100%) rename Tests/{ => Integration}/test-caldav-scheduling.py (100%) rename Tests/{ => Integration}/test-config.py (100%) rename Tests/{ => Integration}/test-davacl.py (100%) rename Tests/{ => Integration}/test-ical.py (100%) rename Tests/{ => Integration}/test-maildav.py (100%) rename Tests/{ => Integration}/test-webdav.py (100%) rename Tests/{ => Integration}/test-webdavlib.py (100%) rename Tests/{ => Integration}/test-webdavsync.py (100%) rename Tests/{ => Integration}/utilities.py (100%) rename Tests/{ => Integration}/webdavlib.py (100%) rename {UnitTests => Tests/Unit}/GNUmakefile (100%) rename {UnitTests => Tests/Unit}/SOGoTest.h (100%) rename {UnitTests => Tests/Unit}/SOGoTest.m (100%) rename {UnitTests => Tests/Unit}/SOGoTestRunner.h (100%) rename {UnitTests => Tests/Unit}/SOGoTestRunner.m (100%) rename {UnitTests => Tests/Unit}/TestBSJSONAdditions.m (100%) rename {UnitTests => Tests/Unit}/sogo-tests.m (100%) diff --git a/.mtn-ignore b/.mtn-ignore index 581bd96cf..4473e0e35 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -21,4 +21,4 @@ SOPE/NGCards/samples/CardElement.m SOPE/NGCards/samples/CardGroup.m SOPE/NGCards/samples/CardVersitRenderer.m SOPE/NGCards/samples/NGCardsSaxHandler.m -Tests/config.py +Tests/Integration/config.py diff --git a/ChangeLog b/ChangeLog index da5ea98ff..71a21fc87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-24 Ludovic Marcotte + + * Reorganized the layout of automated tests. + 2010-01-22 Francis Lachapelle * UI/Contacts/UIxListEditor.m (-references): avoid printing the diff --git a/Tests/Integration/README b/Tests/Integration/README new file mode 100644 index 000000000..db62e4ed4 --- /dev/null +++ b/Tests/Integration/README @@ -0,0 +1,56 @@ +setup +----- + +(you need "python-simplejson", "python-xml", "python-vobject" and "python-m2crypto" + in order to run the scripts on Debian) + +1) copy config.py.in to config.py (make sure to never EVER add it to monotone) +2) edit config.py to suit your environment +3) run the test scripts + +runnable scripts +---------------- + +all.py - run all scripts below at once +test-webdavsync.py - explicit +test-davacl.py - dav acl tests for calendar and addressbook modules + +other scripts +------------- + +propfind.py - a sample implementation of a PROPFIND request using webdavlib + +* developers +------------ + +- Test methods are always prefixed with "test". Sometimes, it's easier to +track down a problem by enabling only one test at a time. One possible method +is to replace "def test" with "def xtest" and replace it back when the +problems are solved. + +- Test failures start with "FAIL:". Those are the ones that indicate possible + bugs in the application, if the test is itself known to work. + For example like this: + +====================================================================== +FAIL: 'modify' PUBLIC, 'view all' PRIVATE, 'view d&t' confidential +---------------------------------------------------------------------- +Traceback (most recent call last): + File "./davacl.py", line 75, in testModifyPublicViewAllPrivateViewDConfidential + self._testRights({ "pu": "m", "pr": "v", "co": "d" }) + File "./davacl.py", line 119, in _testRights + self._testCreate(rights) + File "./davacl.py", line 165, in _testCreate + exp_code) + File "./davacl.py", line 107, in _putEvent + % (exp_status, put.response["status"])) +AssertionError: event creation/modification: expected status code '403' (received '201') + +- Test errors start with "ERRORS" and most likely indicate a bug in the test + code itself. + +- Always set a doc string on the test methods, especially for complex test + cases. + +- When writing tests, be aware that contrary to unit tests, functional tests + often imply a logical order between the different steps. diff --git a/Tests/all.py b/Tests/Integration/all.py similarity index 100% rename from Tests/all.py rename to Tests/Integration/all.py diff --git a/Tests/config.py.in b/Tests/Integration/config.py.in similarity index 100% rename from Tests/config.py.in rename to Tests/Integration/config.py.in diff --git a/Tests/preferences.py b/Tests/Integration/preferences.py similarity index 100% rename from Tests/preferences.py rename to Tests/Integration/preferences.py diff --git a/Tests/propfind.py b/Tests/Integration/propfind.py similarity index 100% rename from Tests/propfind.py rename to Tests/Integration/propfind.py diff --git a/Tests/test-caldav-scheduling.py b/Tests/Integration/test-caldav-scheduling.py similarity index 100% rename from Tests/test-caldav-scheduling.py rename to Tests/Integration/test-caldav-scheduling.py diff --git a/Tests/test-config.py b/Tests/Integration/test-config.py similarity index 100% rename from Tests/test-config.py rename to Tests/Integration/test-config.py diff --git a/Tests/test-davacl.py b/Tests/Integration/test-davacl.py similarity index 100% rename from Tests/test-davacl.py rename to Tests/Integration/test-davacl.py diff --git a/Tests/test-ical.py b/Tests/Integration/test-ical.py similarity index 100% rename from Tests/test-ical.py rename to Tests/Integration/test-ical.py diff --git a/Tests/test-maildav.py b/Tests/Integration/test-maildav.py similarity index 100% rename from Tests/test-maildav.py rename to Tests/Integration/test-maildav.py diff --git a/Tests/test-webdav.py b/Tests/Integration/test-webdav.py similarity index 100% rename from Tests/test-webdav.py rename to Tests/Integration/test-webdav.py diff --git a/Tests/test-webdavlib.py b/Tests/Integration/test-webdavlib.py similarity index 100% rename from Tests/test-webdavlib.py rename to Tests/Integration/test-webdavlib.py diff --git a/Tests/test-webdavsync.py b/Tests/Integration/test-webdavsync.py similarity index 100% rename from Tests/test-webdavsync.py rename to Tests/Integration/test-webdavsync.py diff --git a/Tests/utilities.py b/Tests/Integration/utilities.py similarity index 100% rename from Tests/utilities.py rename to Tests/Integration/utilities.py diff --git a/Tests/webdavlib.py b/Tests/Integration/webdavlib.py similarity index 100% rename from Tests/webdavlib.py rename to Tests/Integration/webdavlib.py diff --git a/Tests/README b/Tests/README index db62e4ed4..43988570b 100644 --- a/Tests/README +++ b/Tests/README @@ -1,56 +1,8 @@ -setup ------ +This directory holds automated tests for SOGo. -(you need "python-simplejson", "python-xml", "python-vobject" and "python-m2crypto" - in order to run the scripts on Debian) +We currrently have: -1) copy config.py.in to config.py (make sure to never EVER add it to monotone) -2) edit config.py to suit your environment -3) run the test scripts + - Intregation holds all interated tests that are used to + validate overall DAV functionality right now -runnable scripts ----------------- - -all.py - run all scripts below at once -test-webdavsync.py - explicit -test-davacl.py - dav acl tests for calendar and addressbook modules - -other scripts -------------- - -propfind.py - a sample implementation of a PROPFIND request using webdavlib - -* developers ------------- - -- Test methods are always prefixed with "test". Sometimes, it's easier to -track down a problem by enabling only one test at a time. One possible method -is to replace "def test" with "def xtest" and replace it back when the -problems are solved. - -- Test failures start with "FAIL:". Those are the ones that indicate possible - bugs in the application, if the test is itself known to work. - For example like this: - -====================================================================== -FAIL: 'modify' PUBLIC, 'view all' PRIVATE, 'view d&t' confidential ----------------------------------------------------------------------- -Traceback (most recent call last): - File "./davacl.py", line 75, in testModifyPublicViewAllPrivateViewDConfidential - self._testRights({ "pu": "m", "pr": "v", "co": "d" }) - File "./davacl.py", line 119, in _testRights - self._testCreate(rights) - File "./davacl.py", line 165, in _testCreate - exp_code) - File "./davacl.py", line 107, in _putEvent - % (exp_status, put.response["status"])) -AssertionError: event creation/modification: expected status code '403' (received '201') - -- Test errors start with "ERRORS" and most likely indicate a bug in the test - code itself. - -- Always set a doc string on the test methods, especially for complex test - cases. - -- When writing tests, be aware that contrary to unit tests, functional tests - often imply a logical order between the different steps. + - Unit holds all unit tests diff --git a/UnitTests/GNUmakefile b/Tests/Unit/GNUmakefile similarity index 100% rename from UnitTests/GNUmakefile rename to Tests/Unit/GNUmakefile diff --git a/UnitTests/SOGoTest.h b/Tests/Unit/SOGoTest.h similarity index 100% rename from UnitTests/SOGoTest.h rename to Tests/Unit/SOGoTest.h diff --git a/UnitTests/SOGoTest.m b/Tests/Unit/SOGoTest.m similarity index 100% rename from UnitTests/SOGoTest.m rename to Tests/Unit/SOGoTest.m diff --git a/UnitTests/SOGoTestRunner.h b/Tests/Unit/SOGoTestRunner.h similarity index 100% rename from UnitTests/SOGoTestRunner.h rename to Tests/Unit/SOGoTestRunner.h diff --git a/UnitTests/SOGoTestRunner.m b/Tests/Unit/SOGoTestRunner.m similarity index 100% rename from UnitTests/SOGoTestRunner.m rename to Tests/Unit/SOGoTestRunner.m diff --git a/UnitTests/TestBSJSONAdditions.m b/Tests/Unit/TestBSJSONAdditions.m similarity index 100% rename from UnitTests/TestBSJSONAdditions.m rename to Tests/Unit/TestBSJSONAdditions.m diff --git a/UnitTests/sogo-tests.m b/Tests/Unit/sogo-tests.m similarity index 100% rename from UnitTests/sogo-tests.m rename to Tests/Unit/sogo-tests.m