Running the App Locally
Dependencies: MongoDB at http://quiz-db
and redis at http://redis
.
#!/bin/bash
set -e
export DTU_DATA_ROOT=${DTU_ENOTE_VOL}
export DTU_FILEMANAGER="${DTU_ENOTE_VOL}/filemanager"
export QUIZ_DOMAIN=quiz.docker.local
export DTU_REDIS_URL=docker.local
echo checking for redis...
(printf "PING\r\n";) | nc $DTU_REDIS_URL 6379
echo checking for mongodb...
export $(sed -e 's/:[^:\/\/]/=/g;s/ *=/=/g' ${DTU_DATA_ROOT}/config/quiz-db.yaml | xargs)
bundle exec ruby probe_db.rb
export LOG_LEVEL=debug
export RAILS_ENV=development
bundle exec rails s
Testing the App
You must have DB running to run tests. The script will try to get to ${DTU_DAT_ROOT}/config/quiz-db.yaml
for the username and password. If DTU_DATA_ROOT
is not set, it'll use null username/password.
./scripts/run-tests.sh
docker exec -ti quiz bash -ac 'DTU_DATA_ROOT=/data ./scripts/run-tests.sh'
Run the Load Test
DEPRECATED
This will need to be updated; last touched in 2016.
docker-compose -f docker-compose.prodtest.yml build
docker-compose -f docker-compose.prodtest.yml up -d
And also monitor
docker stats quizrenderer_quiz_1 quizrenderer_mongodb_1 quizrenderer_nginx_1
View the results:
docker logs quizrenderer_loadtest_1
To get the profile:
docker cp quizrenderer_quiz_1:/quiz-renderer/app/tmp/profile tmp/profile