Skip to content

Commit 9ddb913

Browse files
committed
Merge pull request #685 from LearningLocker/issue/conformance-tests
Runs conformance tests on Travis.
2 parents 4cdf4f2 + 7fcdc3d commit 9ddb913

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ before_script:
1717
- php artisan migrate --env="testing"
1818

1919
script: ./vendor/bin/phpunit
20+
after_success: sh test.sh
2021

2122
notifications:
2223
slack:

app/config/local/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
'Jenssegers\Mongodb\Auth\ReminderServiceProvider',
66
)),
77

8-
'debug' => false,
8+
'debug' => true,
99
);

test.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env sh
2+
3+
DEVELOP="develop"
4+
5+
if [ "${DEVELOP}" = "${TRAVIS_BRANCH}" ]; then
6+
echo "Running conformance tests."
7+
8+
# Starts the server.
9+
sudo chmod -R 777 *
10+
php artisan serve --env=testing --host 0.0.0.0 --port=8000 &
11+
12+
# Creates a new User.
13+
mongo ll_staging --eval 'db.users.insert({"name" : "Test User", "email" : "[email protected]", "verified" : "yes", "role" : "super", "password" : "$2y$10$MKDC2thihULF3fNuVj.DyORidVd.airmxZicEcSrpNQRsJMX3ZGBW"})'
14+
15+
# Creates a new LRS.
16+
mongo ll_staging --eval 'db.lrs.insert({"title" : "Conformance", "description" : "", "owner" : { "_id" : db.users.find()[0]._id}})'
17+
18+
# Creates a new Client.
19+
mongo ll_staging --eval 'db.client.insert({"api" : { "basic_key" : "1484c2ac05269b8c5479a1dd6a0d6370991fd6a1", "basic_secret" : "f0ef3d8062805c0fc1675beb8ac0715c75df13cb" }, "lrs_id" : db.lrs.find()[0]._id, "authority" : { "name" : "New Client", "mbox" : "mailto:[email protected]" }, "scopes" : [ "all" ]})'
20+
21+
# Runs the test suite.
22+
git clone https://github.com/ryansmith94/xAPI_LRS_Test.git conformance > /dev/null
23+
cd conformance
24+
git checkout travis > /dev/null
25+
cd src
26+
npm install -g grunt-cli > /dev/null
27+
npm install > /dev/null
28+
grunt --bail --reporter=dot --endpoint="http://0.0.0.0:8000/data/xAPI/" --username="1484c2ac05269b8c5479a1dd6a0d6370991fd6a1" --password="f0ef3d8062805c0fc1675beb8ac0715c75df13cb" --xapi-version="1.0.1"
29+
30+
# Stops the server.
31+
ps aux | grep [p]hp | awk '{print $2}' | xargs kill
32+
echo "Stopped the server."
33+
34+
echo "Completed conformance tests."
35+
else
36+
echo "Not running conformance tests."
37+
fi

0 commit comments

Comments
 (0)