Skip to content
Browse files

ArangoDB Setup on Travis CI

Travis CI now also runs our acceptance tests. Yay!
  • Loading branch information...
1 parent 12ffea3 commit 3c1efd55dda738f812d0bf66ae97862cabb78d8a @moonglum moonglum committed Oct 31, 2012
Showing with 76 additions and 1 deletion.
  1. +2 −0 .travis.yml
  2. +6 −1 Rakefile
  3. +68 −0 spec/setup/arangodb.sh
View
2 .travis.yml
@@ -1,4 +1,6 @@
language: ruby
+before_script:
+ - ./spec/setup/arangodb.sh
rvm:
- 1.9.2
- 1.9.3
View
7 Rakefile
@@ -9,6 +9,11 @@ require "roodi_task"
namespace :spec do
+ desc "Run the integration tests. Requires ArangoDB to be running."
+ RSpec::Core::RakeTask.new(:integration_with_running_arangodb) do |spec|
+ spec.pattern = "spec/integration/*_spec.rb"
+ end
+
desc "Run the integration tests. Requires ArangoDB."
RSpec::Core::RakeTask.new(:integration) do |spec|
spec.rspec_opts = "--require integration/arango_helper.rb"
@@ -94,7 +99,7 @@ end
desc "Run Unit Tests - no ArangoDB required"
# task :ci => ["spec:unit", "yard:verify"]
-task :ci => ["spec:unit", "metrics:all"]
+task :ci => ["spec:unit", "spec:integration_with_running_arangodb", "metrics:all"]
desc "Run all tests and verify documentation - ArangoDB required"
# task :default => ["spec:all", "yard:verify"]
View
68 spec/setup/arangodb.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd $DIR
+
+#VERSION=1.0.2
+VERSION=1.1.beta1
+
+NAME=ArangoDB-$VERSION
+
+if [ ! -d "$DIR/$NAME" ]; then
+ # download ArangoDB
+ wget http://www.arangodb.org/travisCI/$NAME.tar.gz
+ tar zxf $NAME.tar.gz
+fi
+
+
+PID=$(echo $PPID)
+TMP_DIR="/tmp/arangodb.$PID"
+PID_FILE="/tmp/arangodb.$PID.pid"
+ARANGODB_DIR="$DIR/$NAME"
+UPDATE_SCRIPT="${ARANGODB_DIR}/js/server/arango-upgrade.js"
+
+# create database directory
+mkdir ${TMP_DIR}
+
+# check for update script
+echo "looking for: $UPDATE_SCRIPT"
+if [ -f "$UPDATE_SCRIPT" ] ; then
+ # version 1.1
+ ${ARANGODB_DIR}/bin/arangod \
+ --database.directory ${TMP_DIR} \
+ --configuration none \
+ --server.endpoint tcp://127.0.0.1:8529 \
+ --javascript.startup-directory ${ARANGODB_DIR}/js \
+ --javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
+ --javascript.script "$UPDATE_SCRIPT"
+
+ ${ARANGODB_DIR}/bin/arangod \
+ --database.directory ${TMP_DIR} \
+ --configuration none \
+ --server.endpoint tcp://127.0.0.1:8529 \
+ --javascript.startup-directory ${ARANGODB_DIR}/js \
+ --javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
+ --javascript.action-directory ${ARANGODB_DIR}/js/actions/system \
+ --database.maximal-journal-size 1048576 \
+ --server.disable-admin-interface true \
+ --server.disable-authentication true \
+ --javascript.gc-interval 1 &
+else
+ # version 1.0
+ ${ARANGODB_DIR}/bin/arangod ${TMP_DIR} \
+ --configuration none \
+ --pid-file ${PID_FILE} \
+ --javascript.startup-directory ${ARANGODB_DIR}/js \
+ --javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
+ --javascript.action-directory ${ARANGODB_DIR}/js/actions/system \
+ --database.maximal-journal-size 1000000 \
+ --javascript.gc-interval 1 &
+fi
+
+echo "Waiting until ArangoDB is ready on port 8529"
+while [[ -z `curl -s 'http://127.0.0.1:8529/_api/version' ` ]] ; do
+ echo -n "."
+ sleep 2s
+done
+
+echo "ArangoDB is up"

0 comments on commit 3c1efd5

Please sign in to comment.
Something went wrong with that request. Please try again.