diff --git a/services/docstore/Gruntfile.coffee b/services/docstore/Gruntfile.coffee index 05e00c5a42..9e5af27034 100644 --- a/services/docstore/Gruntfile.coffee +++ b/services/docstore/Gruntfile.coffee @@ -6,6 +6,7 @@ module.exports = (grunt) -> app: options: index: "app.js" + coffee: app_src: expand: true, @@ -67,6 +68,10 @@ module.exports = (grunt) -> reporter: grunt.option('reporter') or 'spec' timeout: 10000 src: ["test/smoke/js/**/*.js"] + + shell: + dockerTests: + command: 'docker run -v "$(pwd):/app" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_BUCKET="$AWS_BUCKET" --rm sl-acceptance-test-runner' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-clean' @@ -89,6 +94,8 @@ module.exports = (grunt) -> grunt.registerTask 'test:smoke', ['compile:smoke_tests', 'mochaTest:smoke'] grunt.registerTask 'install', 'compile:app' + + grunt.registerTask 'test:acceptance:docker', ['compile:acceptance_tests', 'shell:dockerTests'] grunt.registerTask 'default', ['run'] diff --git a/services/docstore/test/acceptance/scripts/full-test.sh b/services/docstore/test/acceptance/scripts/full-test.sh new file mode 100755 index 0000000000..9f6167e667 --- /dev/null +++ b/services/docstore/test/acceptance/scripts/full-test.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +npm rebuild + +echo ">> Starting server..." + +grunt --no-color forever:app:start + +echo ">> Server started" + +sleep 5 + +echo ">> Running acceptance tests..." +grunt --no-color mochaTest:acceptance +_test_exit_code=$? + +echo ">> Killing server" + +grunt --no-color forever:app:stop + +echo ">> Done" + +exit $_test_exit_code