Sfoglia il codice sorgente

Merge branch 'master' into ja-set-version-in-docstore

James Allen 10 anni fa
parent
commit
7ede096903

+ 7 - 0
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']
 

+ 23 - 0
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