Skip to content

Commit 0cd21db

Browse files
committed
Travis-CI implementation
Signed-off-by: Frank Mayer <frank@frankmayer.net>
1 parent aff2b6c commit 0cd21db

File tree

4 files changed

+83
-7
lines changed

4 files changed

+83
-7
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
7+
before_script:
8+
- chmod 777 ./tests/travis/setup_arangodb.sh
9+
- ./tests/travis/setup_arangodb.sh
10+
11+
script: phpunit --configuration ./tests/phpunit.xml

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# PHP client for ArangoDB
22

3+
[![Build Status](https://secure.travis-ci.org/triAGENS/ArangoDB-PHP.png)](http://travis-ci.org/triAGENS/ArangoDB-PHP)
4+
35
This PHP client allows REST-based access to documents on the server.
46
The ArangoDocumentHandler class should be used for these purposes.
57
There is an example for REST-based documents access in the file examples/document.php.

tests/phpunit.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
<phpunit bootstrap="bootstrap.php" colors="true" verbose="true" backupGlobals="false">
33
<testsuites>
44
<testsuite name="ArangoDB-PHP">
5-
<file>ConnectionTest.php</file>
6-
<file>CollectionBasicTest.php</file>
7-
<file>CollectionExtendedTest.php</file>
8-
<file>DocumentBasicTest.php</file>
9-
<file>DocumentExtendedTest.php</file>
10-
<file>EdgeBasicTest.php</file>
11-
<file>StatementTest.php</file>
5+
<directory>.</directory>
126
</testsuite>
137
</testsuites>
148
</phpunit>

tests/travis/setup_arangodb.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
cd $DIR
5+
6+
VERSION=1.0.2
7+
#VERSION=1.1.beta1
8+
9+
10+
NAME=ArangoDB-$VERSION
11+
12+
if [ ! -d "$DIR/$NAME" ]; then
13+
# download ArangoDB
14+
wget http://www.arangodb.org/travisCI/$NAME.tar.gz
15+
tar zxf $NAME.tar.gz
16+
fi
17+
18+
19+
PID=$(echo $PPID)
20+
TMP_DIR="/tmp/arangodb.$PID"
21+
PID_FILE="/tmp/arangodb.$PID.pid"
22+
ARANGODB_DIR="$DIR/$NAME"
23+
UPDATE_SCRIPT="${ARANGODB_DIR}/js/server/arango-upgrade.js"
24+
25+
# create database directory
26+
mkdir ${TMP_DIR}
27+
28+
# check for update script
29+
echo "looking for: $UPDATE_SCRIPT"
30+
if [ -f "$UPDATE_SCRIPT" ] ; then
31+
# version 1.1
32+
${ARANGODB_DIR}/bin/arangod \
33+
--database.directory ${TMP_DIR} \
34+
--configuration none \
35+
--server.endpoint tcp://127.0.0.1:8529 \
36+
--javascript.startup-directory ${ARANGODB_DIR}/js \
37+
--javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
38+
--javascript.script "$UPDATE_SCRIPT"
39+
40+
${ARANGODB_DIR}/bin/arangod \
41+
--database.directory ${TMP_DIR} \
42+
--configuration none \
43+
--server.endpoint tcp://127.0.0.1:8529 \
44+
--javascript.startup-directory ${ARANGODB_DIR}/js \
45+
--javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
46+
--javascript.action-directory ${ARANGODB_DIR}/js/actions/system \
47+
--database.maximal-journal-size 1048576 \
48+
--server.disable-admin-interface true \
49+
--server.disable-authentication true \
50+
--javascript.gc-interval 1 &
51+
else
52+
# version 1.0
53+
${ARANGODB_DIR}/bin/arangod ${TMP_DIR} \
54+
--configuration none \
55+
--pid-file ${PID_FILE} \
56+
--javascript.startup-directory ${ARANGODB_DIR}/js \
57+
--javascript.modules-path ${ARANGODB_DIR}/js/server/modules:${ARANGODB_DIR}/js/common/modules \
58+
--javascript.action-directory ${ARANGODB_DIR}/js/actions/system \
59+
--database.maximal-journal-size 1000000 \
60+
--javascript.gc-interval 1 &
61+
fi
62+
63+
echo "Waiting until ArangoDB is ready on port 8529"
64+
while [[ -z `curl -s 'http://127.0.0.1:8529/_api/version' ` ]] ; do
65+
echo -n "."
66+
sleep 2s
67+
done
68+
69+
echo "ArangoDB is up"

0 commit comments

Comments
 (0)