Permalink
Browse files

Add a Makefile target for pulse tests

Add a Makefile target to run the pulse tests. The goal is to make it
as simple as possible to run these tests in order to increase the
likelihood they are run during the normal course of code reviews and
not simply forgotten. The pulse test modules are moved up directly
into the test directory to allow rebar to find them and the test
module is renamed to bitcask_pulse for easier identification.  Also a
new version of rebar that can properly execute the new Makefile target
is added.
  • Loading branch information...
1 parent fc65e3c commit 7443ad243a505f1339008d7ec6b09bfd72cb7176 @kellymclaughlin kellymclaughlin committed Nov 22, 2013
View
@@ -2,22 +2,25 @@ REPO ?= bitcask
BITCASK_TAG = $(shell git describe --tags)
REVISION ?= $(shell echo $(BITCASK_TAG) | sed -e 's/^$(REPO)-//')
PKG_VERSION ?= $(shell echo $(REVISION) | tr - .)
+BASE_DIR = $(shell pwd)
REBAR_BIN := $(shell which rebar)
ifeq ($(REBAR_BIN),)
REBAR_BIN = ./rebar
endif
+PULSE_TESTS = bitcask_pulse
+
.PHONY: rel deps package pkgclean
all: deps compile
compile:
- $(REBAR_BIN) compile
+ $(REBAR_BIN) compile
deps:
$(REBAR_BIN) get-deps
-clean:
+clean:
$(REBAR_BIN) clean
test: deps compile eunit_erlang eunit_nif
@@ -28,6 +31,10 @@ eunit_erlang:
eunit_nif:
IOMODE="nif" $(REBAR_BIN) skip_deps=true eunit
+pulse:
+ @rm -rf $(BASE_DIR)/.eunit
+ $(REBAR_BIN) -D PULSE clean compile
+ $(REBAR_BIN) -D PULSE eunit skip_deps=true suites=$(PULSE_TESTS)
# Release tarball creation
# Generates a tarball that includes all the deps sources so no checkouts are necessary
@@ -47,7 +54,7 @@ buildtar = mkdir distdir && \
mkdir ../$(BITCASK_TAG)/deps && \
make deps; \
for dep in deps/*; do cd $${dep} && $(call archive,$${dep},../../../$(BITCASK_TAG)); cd ../..; done
-
+
distdir:
$(if $(BITCASK_TAG), $(call buildtar), $(error "You can't generate a release tarball from a non-tagged revision. Run 'git checkout <tag>', then 'make dist'"))
View
BIN rebar
Binary file not shown.
@@ -1,8 +1,8 @@
-%%% File : bitcask_eqc.erl
+%%% File : bitcask_pulse.erl
%%% Author : Ulf Norell, Hans Svensson
%%% Description : Bitcask stress testing
%%% Created : 19 Mar 2012 by Ulf Norell
--module(bitcask_eqc).
+-module(bitcask_pulse).
%% The while module is ifdef:ed, rebar should set PULSE
-ifdef(PULSE).
@@ -12,7 +12,7 @@
-include_lib("eqc/include/eqc.hrl").
-include_lib("eqc/include/eqc_statem.hrl").
--include("../../include/bitcask.hrl").
+-include("bitcask.hrl").
-include_lib("eunit/include/eunit.hrl").
@@ -251,7 +251,7 @@ start_node(Verbose) ->
_ -> ok
end,
stop_node(),
- {ok, _} = slave:start(host(), slave_name(), "-pa ../../../ebin " ++
+ {ok, _} = slave:start(host(), slave_name(), "-pa ../ebin " ++
lists:append(["-detached" || not Verbose ])),
ok.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7443ad2

Please sign in to comment.