summaryrefslogtreecommitdiff
path: root/bench/keymanager/Makefile
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-09-06 14:55:27 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-06 14:55:27 -0400
commitdd9c8278379df9f41c5a40dc6bccd2901cf4db10 (patch)
tree87175df9156a493f74ca3ad68829246af5ebb9e2 /bench/keymanager/Makefile
parent1f6f24540bae5b21cabb69b4f50cca7cddb8f784 (diff)
[test] add speed tests for gpg/wrapper init/enc/dec
this is a port of commit 2d9bec78f in the legacy keymanager repo. Additionally, I'm here separating benchmarking tests from the main tox run. In my machine several of these benchmarking tests seem to be broken, due to issue https://github.com/isislovecruft/python-gnupg/issues/157
Diffstat (limited to 'bench/keymanager/Makefile')
-rw-r--r--bench/keymanager/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/bench/keymanager/Makefile b/bench/keymanager/Makefile
new file mode 100644
index 00000000..0a3db779
--- /dev/null
+++ b/bench/keymanager/Makefile
@@ -0,0 +1,37 @@
+# This makefile is currently intended to make it easy to generate the
+# benchmarking graphs.
+
+RESULTS_FILE = tests/results.json
+GRAPH_PREFIX = benchmark
+
+GRAPH_FILE = $(GRAPH_PREFIX)-test_gpg_init.svg
+
+all: $(GRAPH_FILE)
+
+#
+# rules for generating one graph with the results of all speed tests
+#
+
+$(RESULTS_FILE):
+ tox -v test_gpg_speed.py -- -v --pdb -s \
+ --benchmark-max-time=2.0 \
+ --benchmark-json=$(subst tests/,,$@)
+
+$(GRAPH_FILE): $(RESULTS_FILE)
+ py.test-benchmark compare $< --histogram $(GRAPH_PREFIX)
+
+
+#
+# rule for generating one graph for each graph
+#
+
+test:
+ tox -v test_gpg_speed.py -- -v --pdb -s \
+ --benchmark-histogram=gpg_speed \
+ --benchmark-storage=./graphs/ \
+ --benchmark-save=keymanager_gpg_speed \
+
+clean:
+ rm -f $(RESULTS_FILE) $(GRAPH_PREFIX)*.svg
+
+.PHONY: all test graph