Commit Graph

58 Commits

Author SHA1 Message Date
Patrick Ohly edf1314def test: convert scripts to Python3
This is the result of 2to3, with the interpreter path updated manually,
tabs replaced by spaces and some obsolete packages removed.

Required because the current nightly build host no longer has Python2 installed.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2020-12-05 21:28:08 +01:00
Patrick Ohly 1bf4ce81b1 test: switch from .log to .txt for log files
The current HTTP server for nightly.syncevolution.org reports the
content type for .txt files as plain text, but not for .log
files. Plain text is desirable for easy viewing in a web
browser. While the .log suffix is nicer, getting the HTTP server
reconfigured is hard and might have to be repeated again in the
future, so let's just use .txt.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2020-07-24 22:01:33 +02:00
Patrick Ohly 4462536f16 testing: split up local testing
"evolution" tests used to be a traditional name for all Client::Source
and SyncEvolution unit tests. This caused problems when adding
Akonadi (crash in Akonadi client lib when EDS was used before) and
was not nice in the test reporting (multiple different tests all mixed
into one summary line). It also prevented running these tests in parallel.

All of this gets fixed by splitting "evolution" into "eds", "kde",
"file" and "unittests". To avoid updating the nightly test run scripts,
--enable evolution=.... is still understood.
2014-03-31 11:12:21 +02:00
Patrick Ohly 88ac5872a5 testing: more resilient resultchecker.py
Don't assume that each server actually has an entry in the result
list. In case of a failure to write that, treat the server as failed
to highlight the problem instead of failing in the resultchecker.py
script.
2014-02-02 19:32:42 +01:00
Patrick Ohly 70bca00073 testing: separate distcheck
"dist" must complete before being able to install and test packages on
different platforms. By running "make distcheck" separately, we can
start with parallel testing sooner and separately enable/disable
distcheck testing.
2014-01-17 16:15:15 +01:00
Patrick Ohly ed3cf97a87 testing: handle output.txt files with multiple entries per action
Compilation and actual testing will be split into two runtest.py invocations
to support parallelizing of testing. resultchecker.py must handle the
resulting output.txt, which will have multiple entries for for each action:
first compilation followed by skipped testing, then skipped compilation
followed by testing. resultcheckper.py must report the non-skipped
results and only fall back to "skipped" if none are found.

In addition, make it clear that the initial steps are about the source code by
renaming the step in the report with a "-source" suffix.
2014-01-17 16:15:14 +01:00
Patrick Ohly b37eadf203 testing: support result checking in platforms which have no pkg-config
When testing pre-compiled binaries it may happen that we cannot
determine library versions with pkg-config because development
files are not installed. Ignore these errors and skip adding
library version numbers.
2014-01-17 16:15:14 +01:00
Patrick Ohly 228d479a6b testing: prepare running in incomplete chroots
The resultchecker.py script must not rely on being able to cd into
a specific directory and then having the chroot use that same directory,
because paths may be different. Instead always use absolute paths inside
the schroot commands.
2014-01-17 16:08:15 +01:00
Patrick Ohly e1fb7eb282 testing: prepare running in incomplete chroots
In the future, nightly testing will use chroots which copy their root
filesystem and all additional files, instead of bind mounting them as it is
done now. The advantage of that setup is that the test runs become independent
from each other and thus can be parallelized. The downside is that paths to
files created inside the chroot has to be accessed via a different path from
the outside.

runtests.py will be invoked with those outside paths and needs to translate
them to the shorter paths used inside the chroot when invoking commands that
run inside it. This affects the current directory and any paths in the
argument list.
2013-12-09 08:41:06 -08:00
Patrick Ohly 5e530e9c54 testing: cover owndrive.com = OwnCloud
This enables interoperability testing with owndrive.com, a hosted OwnCloud
provider. owndrive.com was chosen because a user picked it and support was
able to help with some problems. It's also a bit simpler than running OwnCloud
ourselves. But it may also be slower, so perhaps ultimately a local
installation will be needed.
2013-10-01 09:28:39 +02:00
Patrick Ohly 046d4c31a9 testing: cover Google CardDAV
This adds testing of Google Contacts syncing via CardDAV. It passes
only thanks to the simplified EDS contacts test cases, with one exception:
removing extensions is known to fail because the server keeps them even
when receiving an update without them.
2013-10-01 09:28:39 +02:00
Patrick Ohly fcdb78717f PIM testing: initial tests for PIM Manager API
Start testing the new org._01.pim.contacts D-Bus API, as implemented
by SyncEvolution with EDS as storage.

Currently EDS has a race condition where an ESource becomes
unremovable when reusing the UID. Therefore the tests temporarily
avoid doing that.

The sleeps are necessary to prevent problems caused by creating and
removing an ESource before the file monitoring code in
evolution-source-registry can process the file events.
2012-10-25 16:43:47 +02:00
Patrick Ohly f83e5bc8e2 testing: added googleeas = Google Contacts via ActiveSync
Testing shows that compared to Exchange, some additional problems
exist, which are ignored via synccompare:
- FN gets overwritten.
- CATGEORIES are lost.

Not sure whether anything can be done, so let's consider this
permanently broken.

BDAY also gets modified. Perhaps that can be fixed, so a synccompare
workaround will be commit separately so that it can be reverted later.
2012-07-18 13:35:46 +00:00
Patrick Ohly 24f1487b51 testing: fixed HTML results for suspend/resume tests (part of BMC #1367)
Suspend/Resend/Retry are sub-groups of Client::Sync. They need to be enabled
when gathering the list of all sync tests. Finding the right logs needs to
be tweaked because of different naming and several logs per tests.
2012-04-26 11:46:27 +00:00
Patrick Ohly a1ed2cb9f6 testing: fixed result checking for restart tests
resultchecker.py must configure client-test so that it enables
the restart tests when asked for a list of existing tests. The
nightly HTML overview was incomplete without this change.
2012-03-06 14:09:15 +01:00
Patrick Ohly cd7cc5e7bc testing: added activesyncd compilation + coverage
activesyncd gets compiled completely (which should always succeed) and
then only the required pieces are installed (without the things which
are hard-coded for /usr, because installing those will fail).

Testing is done by running a similar set of client-test tests as for remove
CalDAV/CardDAV servers.

activesyncd is started anew each time client-test is run, done in
the new wrappercheck.sh script. Can be combined with valgrindcheck.sh:
wrappercheck.sh valgrindcheck.sh activesyncd -- valgrindcheck.sh client-test ...

The return code of wrappercheck.sh is the return code of the real command
or the daemon, if the real command succeeded. This way the special 100 return
code from valgrindcheck.sh is returned if the only problems were memory
issues.
2011-12-08 13:59:32 +00:00
Patrick Ohly 3ff6ab7dff testing: better skipping of irrelevant log files
Instead of hard-coding a set of .log files which need to be skipped,
only do it for files which match the expected naming pattern. Also
only match the base name of the file instead of the full path,
to avoid mismatches.
2011-12-08 13:59:31 +00:00
Patrick Ohly c4beafccd5 D-Bus testing: more fixes for parsing of Python 2.7 output + HTML output
Some tests were incorrectly marked as "okay" because the there was
a line in the error message matching the "okay" regex. Now the pattern
also expects "okay" or "ok" at the end of the line.

The logic for detecting the start and end of an error report did not handle
multiple errors for a test. Now it does not overwrite an already opened
.log file anymore and keeps writing into it until some line really
indicates the beginning of another error.

As a new feature, the .html version of the .log file is written at the
same time as the .log file. It contains minor color coding. Its main
advantage is separation of D-Bus and stdout output and anchors with quick
links at the top of the page (can be used for skipping the D-Bus output).
2011-12-05 17:20:00 +00:00
Patrick Ohly 4fc6c3e2c4 Merge remote-tracking branch 'origin/syncevolution-1-2-branch'
Conflicts:
	configure.ac
	src/syncevo-dbus-server.cpp
	src/syncevo/Cmdline.cpp
	test/ClientTest.cpp
	test/ClientTest.h
	test/generate-html.xsl
	test/runtests.py

Conflicts caused by backporting + merging back slightly modified
backports.
2011-11-28 10:16:57 +01:00
Patrick Ohly 2df5a2896a D-Bus testing: fixed error reporting
On Debian Testing with Python 2.7 the nightly report did not properly
report failed tests. That's because now python-unit writes error
reports with the failed function on the error line, instead of using
the doc string.  The change is useful (because doc strings are not
necessarily enough to identify the test, which SyncEvolution had to
work around by imposing a specific format of the doc strings), but the
change broke output parsing. Now both old and new output is matched.
2011-11-18 15:17:21 +00:00
Patrick Ohly 436af6cbd8 testing: improved automatic integration + reporting
Merge branches are removed locally before fetching from the remote repo.
Ensures that obsolete branched which where removed from the remote repo
also no longer exist locally. By itself, "git fetch" doesn't do that.

Automatic integration ignores branches which were already merged into
the upstream remote branch. Avoids redundant listing of branches
in the integration report which didn't really need to be merged for the
test run.

Unstaged and staged changes ("stash") are included in the patch report.
The patches are sorted from oldest to most recent. Fixed the fallback
code when a patch has no Subject.

The scripts for reporting tests results are taken from the merged
source code. That ensures that the reporting matches the tests
that were run. The versions from the boot-strapping SyncEvolution
code are the fallback, just in case that automatic integration
fails.

(cherry picked from commit 33bbf5df57)

Conflicts:

	test/generate-html.xsl

In contrast to the master branch, URLs are still absolute because
backporting those changes would have been more difficult.
2011-11-18 15:16:22 +00:00
Patrick Ohly 33bbf5df57 testing: improved automatic integration + reporting
Merge branches are removed locally before fetching from the remote repo.
Ensures that obsolete branched which where removed from the remote repo
also no longer exist locally. By itself, "git fetch" doesn't do that.

Automatic integration ignores branches which were already merged into
the upstream remote branch. Avoids redundant listing of branches
in the integration report which didn't really need to be merged for the
test run.

Unstaged and staged changes ("stash") are included in the patch report.
The patches are sorted from oldest to most recent. Fixed the fallback
code when a patch has no Subject.

The scripts for reporting tests results are taken from the merged
source code. That ensures that the reporting matches the tests
that were run. The versions from the boot-strapping SyncEvolution
code are the fallback, just in case that automatic integration
fails.

The URLs in the on-disk HTML are all relative. That allows rsyncing
the results directories without having to translate hrefs. The version
sent via mail still has absolute external URLs (the original motivation
for embedding the full URL).
2011-11-09 10:37:05 +00:00
Patrick Ohly 741d55e8bf testing: renamed LinkedItems tests, added "no ID" variants
Numbering Client::Source::LinkedItems_xxx with xxx being a number is
confusing, in particular when the same number stands for different
test data. Now each set of linked items has an additional, unique name
which is used for Client::Source::LinkedItems<Name>.

Done in combination with adding more linked item tests and slightly
reorganizing the logic for adding them:
- a default set with VTIMEZONE is added in all cases
- some SyncML servers override that default set
- others, in particular peers accessed via their own backend,
  enable additional Client::Source tests on a case-by-case basis

Exchange is only tested with its own default set (with "Standard
Timezone" as TZID) and the all-day recurring set (as before).

All other CalDAV servers are now also tested with the all-day
set (previously exclusive to Exchange) and local floating time (= no
TZID, new).

Google CalDAV can't be tested with local time because it converts such
events into the time zone of the current user. All-day events need
special test data because Google adds a time to the UNTIL clause
(http://code.google.com/p/google-caldav-issues/issues/detail?id=63).

synccompare also needs to ignore that Google adds a redundant VTIMEZONE
to the all-day test cases.

Finally, Client::Source tests for updating a child event (with and
without parent) without UID and RECURRENCE-ID inside the payload were
added. These properties are removed via text operations. The
expectation is that the source is able to add them back (if needed)
based on the meta information that it has about the existing item.

The file source is unable to do that. When using it in an HTTP server,
the server will look to peers like a peer which doesn't support the
semantic (which indeed it doesn't) and thus the client will add back
the fields.
2011-11-04 11:04:38 +01:00
Patrick Ohly 81c6d37e1d testing: automatically integrate branches (BMC #735)
Branches committed to the libsynthesis or SyncEvolution git repo with
a name of "for-<branch>/<name>" will be automatically merged into
<branch> before starting the testing:
   --sourcedir <dir with existing repos> --workdir <dir with merged repos>

The result can be reused as-is in further runtests.py invocation by using
   --sourcedir <merged repos> --no-sourcedir-copy

Any local, *uncommitted* changes will be preserved and applied to
the merged sources (git stash). *Committed* changes will *not* be
applied. Always push them immediately.

Because there is a risk of loosing work when these rules are not
followed, the current state of the tree is stored as a branch created
with "git stash create" under the names
<branch>-nightly-before-<date+time> and <branch>-nightly. The latter
gets overwritten during each run.

These branches can be used to cherry-pick commits or restore the tree
as it was before the automatic merging ("git stash branch <branchname>
<branch>-nightly").

Result reporting includes information about the resulting code
revision.  This includes the names of all branches which were
available for merging and whether that succeeded or failed. The output
of "git describe" is also included, always with a hash (even when it
matches a tag, in case that the tag gets moved) and whether the
working tree was dirty. All commits applied to the base branch are
listed in "git am" format.

This is done because the merged code is not pushed. This would clutter
the upstream code repository.

The "for-" prefix (instead of just "<branch>/") was added because git
got confused when <branch> was both a real branch and a directory of
other branches.
(cherry picked from commit 3e9fc042dc)
2011-10-28 09:01:18 +02:00
Patrick Ohly 3e9fc042dc testing: automatically integrate branches (BMC #735)
Branches committed to the libsynthesis or SyncEvolution git repo with
a name of "for-<branch>/<name>" will be automatically merged into
<branch> before starting the testing:
   --sourcedir <dir with existing repos> --workdir <dir with merged repos>

The result can be reused as-is in further runtests.py invocation by using
   --sourcedir <merged repos> --no-sourcedir-copy

Any local, *uncommitted* changes will be preserved and applied to
the merged sources (git stash). *Committed* changes will *not* be
applied. Always push them immediately.

Because there is a risk of loosing work when these rules are not
followed, the current state of the tree is stored as a branch created
with "git stash create" under the names
<branch>-nightly-before-<date+time> and <branch>-nightly. The latter
gets overwritten during each run.

These branches can be used to cherry-pick commits or restore the tree
as it was before the automatic merging ("git stash branch <branchname>
<branch>-nightly").

Result reporting includes information about the resulting code
revision.  This includes the names of all branches which were
available for merging and whether that succeeded or failed. The output
of "git describe" is also included, always with a hash (even when it
matches a tag, in case that the tag gets moved) and whether the
working tree was dirty. All commits applied to the base branch are
listed in "git am" format.

This is done because the merged code is not pushed. This would clutter
the upstream code repository.

The "for-" prefix (instead of just "<branch>/") was added because git
got confused when <branch> was both a real branch and a directory of
other branches.
2011-10-27 16:46:22 +00:00
Patrick Ohly c3123aa7d3 testing: added Oracle and eGroupware CalDAV/CardDAV testing
"oracle" is used as server name for Oracle. Oracle Beehive also
still exists, but seems less relevant now.

"egroupware-dav" is used for eGroupware when using CalDAV/CardDAV,
to distinguish this from the older eGroupware SyncML testing.
2011-10-17 13:17:42 +02:00
Patrick Ohly 97d1134436 testing: improved linkedItems tests (with and without VALARM)
With Google Calendar, having a VALARM leads to different communication
compared to the case without VALARM (requires resending). Test both
cases by providing multiple sets of linked items.

Client::Source now contains LinkedItems_1 and LinkedItems_2
sub-groups. This required changes in resultchecker.py, to keep these
tests as listed in the same table as the other source tests.

ClientTestConfig becomes more complicated: it used to be a plain C
struct which could be copied/cleaned with memcpy/memset. This approach
is kept by adding a pointer to a std::vectore. A nicer solution would
be to turn all "const char *" into std::string and int/bool values
with wrapper classes which initialize them.
2011-08-26 08:31:40 +00:00
Patrick Ohly 1e01a10eba testing: better Client::Sync test overview
First, the list of tests was incomplete because there is no single
source which has all tests enabled. Must create a union of all enabled
tests. Do it so that non-standard tests are listed last.

Second, don't break that order when creating the HTML output. Order as
run is better than alphabetical order.
2011-08-17 10:04:20 +00:00
Patrick Ohly 28f61a68eb testing: include Client::Sync::*::testLinked* in output
resultchecker.py builds a list of all sync tests. Must do that
based on a source with events, otherwise the testLinked sync
tests are not enabled.
2011-08-12 19:12:58 +00:00
Patrick Ohly 29ef449c68 testing: added DAViCal
Added CalDAV/CardDAV testing against DAViCal. Passes fine with
DAViCal 0.9.9.4-1.
2011-08-12 19:12:58 +00:00
Patrick Ohly 024418a00b D-Bus testing: also create logs for successful tests
Successful tests don't have output. At least record the
full test function description. Avoids dangling links
in the .html output.
2011-06-30 17:09:17 -07:00
Patrick Ohly 5cd6c39890 D-Bus testing: integrated into nightly testing (BMC #5609)
runtests.py - made the SyncEvolutionTest class configurable so that it
can run test-bus.py, added "--enable=dbus" with it.

resultchecker.py - parse the output of test-dbus.py and split out the
failure reports for linking.
2011-06-30 16:50:36 -07:00
Patrick Ohly bf0de7beb9 nightly testing: fixed extracting result code
The parser for *.log files failed for eds_event/contact/...
As a result, checking for the test result failed.
Replaced with more sane regex matching.
2011-05-13 18:06:43 +08:00
Patrick Ohly a3b4e0769d nightly testing: handle runs without tests, part II
An empty "server" parameter still wasn't handled
correctly, leading to missing result emails.
Empty string must be treated like an empty list.

resultchecker.py incorrectly stored the result of
googlecalendar for google because it was only checking
the line prefix. Now the check ensures that the line
starts with a complete word matching the server name.
2011-05-05 20:16:10 +08:00
Patrick Ohly b6861ed768 nightly testing: renamed ical20/itodo20/vcard30/text, removed vcard21 from Evolution backend (BMC #14972)
The distinction between vcard21 and vcard30 became mute in the Evolution
backend a while ago. Both tests ended up using the vCard 3.0 Evolution
tests data and the default uri for each server. This patch removes
the vCard 2.1 special case.

It also renames the tests and test data to reflect that they always
were Evolution specific. The new naming convention, also applied
to file, QtContacts, KCalExtended, XMLRPC, Maemo and Akonadi backends, is
now <backend>_contact/event/task/memo, with eds/file/qt/kcal/maemo/kde
as backend names.

The reasoning is:
- results in unique string (in particular no overlap with
  backend type names), easier to search for
- underscore already used before (in contrast to hyphen)
- no plural-s to keep the name shorter

The Akonadi backend should be using its own test data instead of
the Evolution ones.
2011-05-05 20:15:55 +08:00
Patrick Ohly 93c3bb5ea2 resultchecker.py: don't make assumptions about "schroot"
The script assumed that "schroot" was always used as "schroot -c <chroot>".
That broke when using "schroot -v -c <chroot>" for debugging.

This patch removes the assumption by inserting -i into the
schroot invocation and retrieving the name from the output.
2011-04-30 19:32:26 +08:00
Patrick Ohly be66091476 nightly testing: handle runs without tests
When the preparation failed and no tests were run, no email
with the HTML test report was sent.

Fixing this at two places:
- resultchecker.py always needs a "server" argument,
  even if it is empty
- the compare style sheet depends on a testing section,
  so write at least an empty one
2011-04-30 19:32:26 +08:00
Patrick Ohly be95fddac5 nightly testing: added Apple Calendar Server testing
runtests.py now has an entry for Apple Calendar Server,
with both CardDAV and CalDAV. The actual installation
can be local. To use this test, set up source-config@client-test-apple
with the correct syncURL and credentials.
2011-04-12 22:37:09 +08:00
Patrick Ohly 0e24eb7186 nightly testing: fixed names and links for sources with underscore
A previous fix for calendar+todo in the source name introduced
escaping of the special + character. This escaping also replaced _
with __. Unescaping was missing in several places, leading to
google_caldav being shown as google__caldav with links to non-existent
files Client_Source_google_caldav_testOpen.log.
2011-04-12 11:30:40 +02:00
Patrick Ohly 2b9fdd0675 nightly test: include Client::Sync::*::testTimeout in report
This test is a bit special because it is only run for the first source
and doesn't really talk to the server. The logic in resultchecker.py
missed that test because the invocation of "client-test --help" didn't
print that test for "vcard21". Fixed by ensuring that only "vcard21"
is active during the --help call.
2011-04-12 11:25:59 +02:00
Patrick Ohly f438e5327c nightly testing: show source test results sorted by time
The Client::Source tests were sorted by name. This was confusing
because it hides when a peer like a CalDAV server stops responding
after a certain test.

It is more intuitive to present the results in the order in which they
were run. This is accomplished by sorting by the sub-second modification
time of the corresponding .log files (in resultschecker.py) and keeping
that order (in generate-html.xsl).

A similar approach might also be useful for Client::Sync. Not done yet.
2011-04-12 11:25:09 +02:00
Patrick Ohly 3ad1911705 runtests.py: added Yahoo and Google CalDAV/CardDAV testing
Added separate Client::Source tests for Yahoo CalDAV/CardDAV
and Google CalDAV. Reporting the results needs to know that these
"servers" are local tests.

These tests can only be run if CLIENT_TEST_WEBDAV is set as
expected by WebDAVSourceRegister.cpp.
2011-04-01 18:26:37 +08:00
Patrick Ohly 5a4c91382c nightly testing: added a column for "network failure"
This column is useful to determine at a glance whether tests
failed because of something outside of our control. The value
is also shown for each single test.
2010-09-02 13:48:46 +02:00
Zhu, Yongsheng deee96a368 Testing: add 'known failure' support in nightly (MBC#2870)
When a failure is known and it should not be treated as
a 'failed' case. Instead, 'knownfailure' is used to indicate
it. Thus, a new testing status for each case is shown in
the nightly testing outputs.
2010-06-17 09:28:19 +02:00
Zhu, Yongsheng 0f36e5801b Testing: fix wrong link for calendar+todo issue (MBC #1397)
If the source type is 'calendar+todo' type, XML spec doesn't allow
'+' in the element tag. Thus the current solution is to replace
'calendar+todo' with 'calendar_todo'.

But this is not a good choice. Instead, escaped strings are used.
"_" is escaped to "__". "+" is escaped to "_-".
So firstly escape these 2 characters when generating nightly xml
documents and then unescape them when generating nightly html page.
2010-05-18 08:47:25 +02:00
Chen Congwu 3fb68fe84a resultchecker: wrote 'calendar_todo' as tag name for 'calendar+todo'
'+' is a special character in the tag name, let's avoid it.
2010-04-20 09:22:10 +08:00
Chen Congwu 837c0429c8 Testing: Fix no html report error (MB#8391)
Do not write 'parameter' property, as the value sometimes fails the XML parser.
Generate a default HTML report if the report failed to generate.
2010-01-22 16:34:54 +01:00
Chen Congwu d24433e06d Testing: result check
Do not grep 'valgrind' because 'valgrind' is not guranteed to run
2009-12-01 21:45:34 +01:00
Chen Congwu ed099f8413 Testing: A special case set has slightly differnt case name 2009-12-01 21:45:34 +01:00
Chen Congwu 40470e6ec6 Testing Result Check: check "okay" instead of "fail" because of possible crash
Now the check criteria is:
"sourcename::casename: okay \*\*\*"
if the string is not present, the test result will be failed.
2009-12-01 21:45:34 +01:00