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
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2015-06-18 04:52:52 +0000
+++ tests/CMakeLists.txt 2015-06-23 13:06:25 +0000
@@ -70,13 +70,6 @@
70## 70##
7171
72find_program(DBUS_RUNNER dbus-test-runner)72find_program(DBUS_RUNNER dbus-test-runner)
73find_program(EVOLUTION_CALENDAR_FACTORY evolution-calendar-factory PATHS /usr/lib/evolution/)
74find_program(EVOLUTION_SOURCE_REGISTRY evolution-source-registry PATHS /usr/lib/evolution/)
75find_program(GVFSD gvfsd PATHS /usr/lib/gvfs/)
76OPTION(EVOLUTION_SOURCE_SERVICE_NAME "DBus name for source registry")
77if(NOT EVOLUTION_SOURCE_SERVICE_NAME)
78 set(EVOLUTION_SOURCE_SERVICE_NAME "org.gnome.evolution.dataserver.Sources3")
79endif()
8073
81function(add_eds_ics_test_by_name name)74function(add_eds_ics_test_by_name name)
82 set (TEST_NAME ${name})75 set (TEST_NAME ${name})
@@ -84,15 +77,11 @@
84 target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})77 target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
85 add_test (${TEST_NAME}78 add_test (${TEST_NAME}
86 ${CMAKE_CURRENT_SOURCE_DIR}/run-eds-ics-test.sh79 ${CMAKE_CURRENT_SOURCE_DIR}/run-eds-ics-test.sh
87 ${DBUS_RUNNER} # arg1: dbus-test-runner exec80 ${DBUS_RUNNER} # arg1: dbus-test-runner exec
88 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path81 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path
89 ${TEST_NAME} # arg3: test name82 ${TEST_NAME} # arg3: test name
90 ${EVOLUTION_CALENDAR_FACTORY} # arg4: evolution-calendar-factory exec83 ${CMAKE_CURRENT_SOURCE_DIR}/test-eds-ics-config-files # arg4: base directory for config file template
91 ${EVOLUTION_SOURCE_SERVICE_NAME} # arg5: dbus name for source registry 84 ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics) # arg5: the ical file for this test
92 ${EVOLUTION_SOURCE_REGISTRY} # arg6: evolution-source-registry exec
93 ${GVFSD} # arg7: gvfsd exec
94 ${CMAKE_CURRENT_SOURCE_DIR}/test-eds-ics-config-files # arg8: base directory for config file template
95 ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics) # arg9: the ical file for this test
96endfunction()85endfunction()
97add_eds_ics_test_by_name(test-eds-ics-all-day-events)86add_eds_ics_test_by_name(test-eds-ics-all-day-events)
98add_eds_ics_test_by_name(test-eds-ics-repeating-events)87add_eds_ics_test_by_name(test-eds-ics-repeating-events)
9988
=== modified file 'tests/run-eds-ics-test.sh'
--- tests/run-eds-ics-test.sh 2015-05-21 11:09:52 +0000
+++ tests/run-eds-ics-test.sh 2015-06-23 13:06:25 +0000
@@ -1,19 +1,22 @@
1#!/bin/sh1#!/bin/sh
22
3echo ARG0=$0 # this script3SELF=$0 # this script
4echo ARG1=$1 # full executable path of dbus-test-runner4TEST_RUNNER=$1 # full executable path of dbus-test-runner
5echo ARG2=$2 # full executable path of test app5TEST_EXEC=$2 # full executable path of test app
6echo ARG3=$3 # test name6TEST_NAME=$3 # test name
7echo ARG4=$4 # full executable path of evolution-calendar-factory7CONFIG_DIR=$4 # config files
8echo ARG5=$5 # bus service name of calendar factory8ICS_FILE=$5 # ical file holding test data
9echo ARG6=$6 # full exectuable path of evolution-source-registry9
10echo ARG7=$7 # full executable path of gvfs10echo "this script: ${SELF}"
11echo ARG8=$8 # config files11echo "test-runner: ${TEST_RUNNER}"
12echo ARG8=$9 # ics file12echo "test-exec: ${TEST_EXEC}"
1313echo "test-name: ${TEST_NAME}"
14# set up the tmpdir and tell the shell to purge it when we exit14echo "config-dir: ${CONFIG_DIR}"
15export TEST_TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d $3-XXXXXXXXXX) || exit 115echo "ics-file: ${ICS_FILE}"
16echo "running test '$3' in ${TEST_TMP_DIR}"16
17# set up the tmpdir
18export TEST_TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d ${TEST_NAME}-XXXXXXXXXX) || exit 1
19echo "running test '${TEST_NAME}' in ${TEST_TMP_DIR}"
1720
18# set up the environment variables21# set up the environment variables
19export QT_QPA_PLATFORM=minimal22export QT_QPA_PLATFORM=minimal
@@ -40,23 +43,19 @@
40rm -rf ${XDG_DATA_HOME}43rm -rf ${XDG_DATA_HOME}
4144
42# if there are canned config files for this test, move them into place now45# if there are canned config files for this test, move them into place now
43if [ -d $8 ]; then46if [ -d ${CONFIG_DIR} ]; then
44 echo "copying files from $8 to $HOME"47 echo "copying files from ${CONFIG_DIR} to $HOME"
45 cp --verbose --archive $8/. $HOME48 cp --verbose --archive ${CONFIG_DIR}/. $HOME
46fi49fi
4750
48# if there's a specific ics file to test, copy it on top of the canned confilg files51# if there's a specific ics file to test, copy it on top of the canned config files
49if [ -e $9 ]; then52if [ -e ${ICS_FILE} ]; then
50 echo "copying $9 into $HOME"53 echo "copying ${ICS_FILE} into $HOME"
51 cp --verbose --archive $9 ${XDG_DATA_HOME}/evolution/tasks/system/tasks.ics54 cp --verbose --archive ${ICS_FILE} ${XDG_DATA_HOME}/evolution/tasks/system/tasks.ics
52fi55fi
5356
54# run dbus-test-runner57# run the test
55$1 --keep-env --max-wait=90 \58${TEST_RUNNER} --keep-env --max-wait=90 --task ${TEST_EXEC} --task-name ${TEST_NAME} --wait-until-complete
56--task $2 --task-name $3 --wait-until-complete --wait-for=org.gnome.evolution.dataserver.Calendar4 \
57--task $4 --task-name "evolution" --wait-until-complete -r
58#--task $6 --task-name "source-registry" --wait-for=org.gtk.vfs.Daemon -r \
59#--task $7 --task-name "gvfsd" -r
60rv=$?59rv=$?
6160
62# if the test passed, blow away the tmpdir61# if the test passed, blow away the tmpdir

Subscribers

People subscribed via source and target branches