Skip to content

Commit

Permalink
conda-recipe: Launch a test dvid server before running 'make test'
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarteberg committed Jun 13, 2018
1 parent e3f5bb6 commit 7847acd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
31 changes: 28 additions & 3 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,43 @@ cmake ..\
##

if [[ $CONFIGURE_ONLY == 0 ]]; then
# BUILD
##
## BUILD
##
make -j${CPU_COUNT}


##
## INSTALL
##
# "install" to the build prefix (conda will relocate these files afterwards)
make install

# For debug builds, this symlink can be useful...
#cd ${PREFIX}/lib && ln -s libdvidcpp-g.${DYLIB_EXT} libdvidcpp.${DYLIB_EXT} && cd -

##
## TEST
##
if [[ -z "$SKIP_LIBDVID_TESTS" || "$SKIP_LIBDVID_TESTS" == "0" ]]; then
echo "Running build tests. To skip, set SKIP_LIBDVID_TESTS=1"


# Launch dvid
echo "Starting test DVID server..."
dvid -verbose serve ${RECIPE_DIR}/dvid-testserver-config.toml &
DVID_PID=$!

sleep 5;
if [ ! pgrep -x > /dev/null ]; then
2>&1 echo "*****************************************************"
2>&1 echo "Unable to start test DVID server! "
2>&1 echo "Do you already have a server runnining on port :8000?"
2>&1 echo "*****************************************************"
exit 2
fi

# Kill the DVID server when this script exits
trap 'kill -TERM $DVID_PID' EXIT

# This script runs 'make test', which uses the build artifacts in the build directory, not the installed files.
# Therefore, they haven't been post-processed by conda to automatically locate their dependencies.
# We'll set LD_LIBRARY_PATH to avoid errors from ld
Expand Down
28 changes: 28 additions & 0 deletions conda-recipe/dvid-testserver-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Example simple configuration for DVID with single database backend.
# See config-multidb.toml for full range of configurations including
# email notifications, authentication, and backend assignments.

[server]
# host = "mygreatserver.test.com" # Lets you specify a user-friendly alias for help messages.
httpAddress = "localhost:8000"
rpcAddress = "localhost:8001"
webClient = "./http/dvid-web-console"

[logging]
logfile = "/tmp/dvid.log"
max_log_size = 500 # MB
max_log_age = 30 # days

# If no backend is specified, DVID will return an error unless there is only
# one store, which will automatically be backend.default, as in this example.
# See config-full.toml for example of [backend] use.


# List the different storage systems available for metadata, data instances, etc.
# Any nickname can be used for a store. In this case, it's "raid6" to reflect
# that the directory is on a RAID-6 drive system. Note that all store properties
# like "engine" and "path" should be lower-case by convention.
[store]
[store.raid6]
engine = "basholeveldb"
path = "/tmp/basholeveldb"
3 changes: 3 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ requirements:
- numpy >=1.9,{{NPY_VER}}*
- scikit-image

# DVID is included as a build dependency so we can run 'make test'
- dvid

run:
- boost 1.64.*
- jsoncpp 1.6.2
Expand Down

0 comments on commit 7847acd

Please sign in to comment.