Merge lp:~charlesk/indicator-datetime/faster-eds-tests into lp:indicator-datetime/15.10

Proposed by Charles Kerr
Status: Merged
Approved by: Pete Woods
Approved revision: 414
Merged at revision: 414
Proposed branch: lp:~charlesk/indicator-datetime/faster-eds-tests
Merge into: lp:indicator-datetime/15.10
Diff against target: 116 lines (+35/-47)
2 files modified
tests/CMakeLists.txt (+5/-16)
tests/run-eds-ics-test.sh (+30/-31)
To merge this branch: bzr merge lp:~charlesk/indicator-datetime/faster-eds-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Pete Woods (community) Approve
Review via email: mp+262700@code.launchpad.net

Commit message

Speedups/cleanups to the EDS regression tests

Description of the change

No functionality changes, just cleanups to the EDS test scaffolding.

* don't invoke evolution-calendar-factory directly; let it be activated by dbus. This prevents a second instance of the factory from starting, timing out, and exiting and is what actually speeds up the tests.

* remove unused gvfsd, source-registry, source-service-name references

* add symbolic variables to run-eds-ics-test.sh so that instead of lines like "if [ -d $8 ]; then" we have "if [ -d ${CONFIG_DIR} ]; then"

To post a comment you must log in.
Revision history for this message
Pete Woods (pete-woods) wrote :

Looks reasonable to me

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/CMakeLists.txt'
2--- tests/CMakeLists.txt 2015-06-18 04:52:52 +0000
3+++ tests/CMakeLists.txt 2015-06-23 13:06:25 +0000
4@@ -70,13 +70,6 @@
5 ##
6
7 find_program(DBUS_RUNNER dbus-test-runner)
8-find_program(EVOLUTION_CALENDAR_FACTORY evolution-calendar-factory PATHS /usr/lib/evolution/)
9-find_program(EVOLUTION_SOURCE_REGISTRY evolution-source-registry PATHS /usr/lib/evolution/)
10-find_program(GVFSD gvfsd PATHS /usr/lib/gvfs/)
11-OPTION(EVOLUTION_SOURCE_SERVICE_NAME "DBus name for source registry")
12-if(NOT EVOLUTION_SOURCE_SERVICE_NAME)
13- set(EVOLUTION_SOURCE_SERVICE_NAME "org.gnome.evolution.dataserver.Sources3")
14-endif()
15
16 function(add_eds_ics_test_by_name name)
17 set (TEST_NAME ${name})
18@@ -84,15 +77,11 @@
19 target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
20 add_test (${TEST_NAME}
21 ${CMAKE_CURRENT_SOURCE_DIR}/run-eds-ics-test.sh
22- ${DBUS_RUNNER} # arg1: dbus-test-runner exec
23- ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path
24- ${TEST_NAME} # arg3: test name
25- ${EVOLUTION_CALENDAR_FACTORY} # arg4: evolution-calendar-factory exec
26- ${EVOLUTION_SOURCE_SERVICE_NAME} # arg5: dbus name for source registry
27- ${EVOLUTION_SOURCE_REGISTRY} # arg6: evolution-source-registry exec
28- ${GVFSD} # arg7: gvfsd exec
29- ${CMAKE_CURRENT_SOURCE_DIR}/test-eds-ics-config-files # arg8: base directory for config file template
30- ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics) # arg9: the ical file for this test
31+ ${DBUS_RUNNER} # arg1: dbus-test-runner exec
32+ ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path
33+ ${TEST_NAME} # arg3: test name
34+ ${CMAKE_CURRENT_SOURCE_DIR}/test-eds-ics-config-files # arg4: base directory for config file template
35+ ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics) # arg5: the ical file for this test
36 endfunction()
37 add_eds_ics_test_by_name(test-eds-ics-all-day-events)
38 add_eds_ics_test_by_name(test-eds-ics-repeating-events)
39
40=== modified file 'tests/run-eds-ics-test.sh'
41--- tests/run-eds-ics-test.sh 2015-05-21 11:09:52 +0000
42+++ tests/run-eds-ics-test.sh 2015-06-23 13:06:25 +0000
43@@ -1,19 +1,22 @@
44 #!/bin/sh
45
46-echo ARG0=$0 # this script
47-echo ARG1=$1 # full executable path of dbus-test-runner
48-echo ARG2=$2 # full executable path of test app
49-echo ARG3=$3 # test name
50-echo ARG4=$4 # full executable path of evolution-calendar-factory
51-echo ARG5=$5 # bus service name of calendar factory
52-echo ARG6=$6 # full exectuable path of evolution-source-registry
53-echo ARG7=$7 # full executable path of gvfs
54-echo ARG8=$8 # config files
55-echo ARG8=$9 # ics file
56-
57-# set up the tmpdir and tell the shell to purge it when we exit
58-export TEST_TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d $3-XXXXXXXXXX) || exit 1
59-echo "running test '$3' in ${TEST_TMP_DIR}"
60+SELF=$0 # this script
61+TEST_RUNNER=$1 # full executable path of dbus-test-runner
62+TEST_EXEC=$2 # full executable path of test app
63+TEST_NAME=$3 # test name
64+CONFIG_DIR=$4 # config files
65+ICS_FILE=$5 # ical file holding test data
66+
67+echo "this script: ${SELF}"
68+echo "test-runner: ${TEST_RUNNER}"
69+echo "test-exec: ${TEST_EXEC}"
70+echo "test-name: ${TEST_NAME}"
71+echo "config-dir: ${CONFIG_DIR}"
72+echo "ics-file: ${ICS_FILE}"
73+
74+# set up the tmpdir
75+export TEST_TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d ${TEST_NAME}-XXXXXXXXXX) || exit 1
76+echo "running test '${TEST_NAME}' in ${TEST_TMP_DIR}"
77
78 # set up the environment variables
79 export QT_QPA_PLATFORM=minimal
80@@ -40,23 +43,19 @@
81 rm -rf ${XDG_DATA_HOME}
82
83 # if there are canned config files for this test, move them into place now
84-if [ -d $8 ]; then
85- echo "copying files from $8 to $HOME"
86- cp --verbose --archive $8/. $HOME
87-fi
88-
89-# if there's a specific ics file to test, copy it on top of the canned confilg files
90-if [ -e $9 ]; then
91- echo "copying $9 into $HOME"
92- cp --verbose --archive $9 ${XDG_DATA_HOME}/evolution/tasks/system/tasks.ics
93-fi
94-
95-# run dbus-test-runner
96-$1 --keep-env --max-wait=90 \
97---task $2 --task-name $3 --wait-until-complete --wait-for=org.gnome.evolution.dataserver.Calendar4 \
98---task $4 --task-name "evolution" --wait-until-complete -r
99-#--task $6 --task-name "source-registry" --wait-for=org.gtk.vfs.Daemon -r \
100-#--task $7 --task-name "gvfsd" -r
101+if [ -d ${CONFIG_DIR} ]; then
102+ echo "copying files from ${CONFIG_DIR} to $HOME"
103+ cp --verbose --archive ${CONFIG_DIR}/. $HOME
104+fi
105+
106+# if there's a specific ics file to test, copy it on top of the canned config files
107+if [ -e ${ICS_FILE} ]; then
108+ echo "copying ${ICS_FILE} into $HOME"
109+ cp --verbose --archive ${ICS_FILE} ${XDG_DATA_HOME}/evolution/tasks/system/tasks.ics
110+fi
111+
112+# run the test
113+${TEST_RUNNER} --keep-env --max-wait=90 --task ${TEST_EXEC} --task-name ${TEST_NAME} --wait-until-complete
114 rv=$?
115
116 # if the test passed, blow away the tmpdir

Subscribers

People subscribed via source and target branches