aboutsummaryrefslogtreecommitdiff
path: root/performance-test
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2018-02-04 15:33:34 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2018-02-04 15:33:34 -0500
commitd9be1028d47cb7e98b474df420858a690798810b (patch)
treefb37f83ca098129a5301ef141dc6a5007a0972a9 /performance-test
parenta8fb877ad7e960d69ec10887ff79e24bb99c587c (diff)
parent3c4e64d976eb561ac5157df1bbe5882e3e65b583 (diff)
Merge tag 'debian/0.26-1' into debian/stretch-backports
notmuch Debian 0.26-1 upload (same as 0.26)
Diffstat (limited to 'performance-test')
-rw-r--r--performance-test/.gitignore8
-rwxr-xr-xperformance-test/M00-new.sh2
-rwxr-xr-xperformance-test/M01-dump-restore.sh2
-rwxr-xr-xperformance-test/M02-show.sh2
-rwxr-xr-xperformance-test/M03-search.sh2
-rwxr-xr-xperformance-test/M04-reply.sh2
-rwxr-xr-xperformance-test/M05-reindex.sh11
-rwxr-xr-xperformance-test/M06-insert.sh16
-rwxr-xr-xperformance-test/T00-new.sh2
-rwxr-xr-xperformance-test/T01-dump-restore.sh2
-rwxr-xr-xperformance-test/T02-tag.sh2
-rwxr-xr-xperformance-test/T03-reindex.sh13
-rw-r--r--performance-test/download/.gitignore4
-rw-r--r--performance-test/perf-test-lib.sh15
14 files changed, 65 insertions, 18 deletions
diff --git a/performance-test/.gitignore b/performance-test/.gitignore
index f3f9be41..8a5dabf5 100644
--- a/performance-test/.gitignore
+++ b/performance-test/.gitignore
@@ -1,4 +1,4 @@
-tmp.*/
-log.*/
-corpus/
-notmuch.cache.*/
+/tmp.*/
+/log.*/
+/corpus/
+/notmuch.cache.*/
diff --git a/performance-test/M00-new.sh b/performance-test/M00-new.sh
index a040a97e..aab36e69 100755
--- a/performance-test/M00-new.sh
+++ b/performance-test/M00-new.sh
@@ -2,7 +2,7 @@
test_description='notmuch new'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
# ensure initial 'notmuch new' is run by memory_start
uncache_database
diff --git a/performance-test/M01-dump-restore.sh b/performance-test/M01-dump-restore.sh
index 8fea9824..32ab8dc9 100755
--- a/performance-test/M01-dump-restore.sh
+++ b/performance-test/M01-dump-restore.sh
@@ -2,7 +2,7 @@
test_description='dump and restore'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
memory_start
diff --git a/performance-test/M02-show.sh b/performance-test/M02-show.sh
index d73035ea..2e218fd3 100755
--- a/performance-test/M02-show.sh
+++ b/performance-test/M02-show.sh
@@ -2,7 +2,7 @@
test_description='show'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
memory_start
diff --git a/performance-test/M03-search.sh b/performance-test/M03-search.sh
index 8d026eee..343f5c7c 100755
--- a/performance-test/M03-search.sh
+++ b/performance-test/M03-search.sh
@@ -2,7 +2,7 @@
test_description='search'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
memory_start
diff --git a/performance-test/M04-reply.sh b/performance-test/M04-reply.sh
index 0e1ce087..3c1205db 100755
--- a/performance-test/M04-reply.sh
+++ b/performance-test/M04-reply.sh
@@ -2,7 +2,7 @@
test_description='search'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
memory_start
diff --git a/performance-test/M05-reindex.sh b/performance-test/M05-reindex.sh
new file mode 100755
index 00000000..17e2c824
--- /dev/null
+++ b/performance-test/M05-reindex.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+test_description='reindex'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+
+memory_start
+
+memory_run 'reindex *' "notmuch reindex '*'"
+
+memory_done
diff --git a/performance-test/M06-insert.sh b/performance-test/M06-insert.sh
new file mode 100755
index 00000000..5ae0656a
--- /dev/null
+++ b/performance-test/M06-insert.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+test_description='search'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+
+memory_start
+
+mkdir -p "$MAIL_DIR"/{cur,new,tmp}
+
+for count in {1..20}; do
+ generate_message "[file]=\"insert-$count\"" "[dir]='tmp/'"
+ memory_run "insert $count" "notmuch insert < $gen_msg_filename"
+done
+
+memory_done
diff --git a/performance-test/T00-new.sh b/performance-test/T00-new.sh
index b9f21158..68750129 100755
--- a/performance-test/T00-new.sh
+++ b/performance-test/T00-new.sh
@@ -2,7 +2,7 @@
test_description='notmuch new'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
uncache_database
diff --git a/performance-test/T01-dump-restore.sh b/performance-test/T01-dump-restore.sh
index 9cfd5cd6..12f12e66 100755
--- a/performance-test/T01-dump-restore.sh
+++ b/performance-test/T01-dump-restore.sh
@@ -2,7 +2,7 @@
test_description='dump and restore'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
time_start
diff --git a/performance-test/T02-tag.sh b/performance-test/T02-tag.sh
index dacb50b8..8c5dfd68 100755
--- a/performance-test/T02-tag.sh
+++ b/performance-test/T02-tag.sh
@@ -2,7 +2,7 @@
test_description='tagging'
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
time_start
diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh
new file mode 100755
index 00000000..d6d5c3c3
--- /dev/null
+++ b/performance-test/T03-reindex.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+test_description='tagging'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+
+time_start
+
+time_run 'reindex *' "notmuch reindex '*'"
+time_run 'reindex *' "notmuch reindex '*'"
+time_run 'reindex *' "notmuch reindex '*'"
+
+time_done
diff --git a/performance-test/download/.gitignore b/performance-test/download/.gitignore
index 7b092346..5c356204 100644
--- a/performance-test/download/.gitignore
+++ b/performance-test/download/.gitignore
@@ -1,2 +1,2 @@
-*.tar.gz
-*.tar.xz
+/*.tar.gz
+/*.tar.xz
diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
index c89d5aab..b70288cc 100644
--- a/performance-test/perf-test-lib.sh
+++ b/performance-test/perf-test-lib.sh
@@ -1,4 +1,4 @@
-. ./version.sh || exit 1
+. $(dirname "$0")/version.sh || exit 1
corpus_size=large
@@ -25,12 +25,19 @@ do
echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
esac
done
-. ../test/test-lib-common.sh || exit 1
+
+# Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set.
+. $(dirname "$0")/../test/export-dirs.sh || exit 1
+
+# Where to run the tests
+TEST_DIRECTORY=$NOTMUCH_BUILDDIR/performance-test
+
+. "$NOTMUCH_SRCDIR/test/test-lib-common.sh" || exit 1
set -e
-if ! test -x ../notmuch
-then
+# It appears that people try to run tests without building...
+if [[ ! -x "$NOTMUCH_BUILDDIR/notmuch" ]]; then
echo >&2 'You do not seem to have built notmuch yet.'
exit 1
fi