2014-04-28 11:45:59 -04:00
|
|
|
spawn = require("child_process").spawn
|
|
|
|
|
|
|
|
module.exports = (grunt) ->
|
|
|
|
grunt.initConfig
|
2014-04-28 11:53:51 -04:00
|
|
|
forever:
|
|
|
|
app:
|
|
|
|
options:
|
|
|
|
index: "app.js"
|
2016-11-28 11:51:43 -05:00
|
|
|
|
2014-04-28 11:45:59 -04:00
|
|
|
coffee:
|
|
|
|
app_src:
|
|
|
|
expand: true,
|
|
|
|
flatten: true,
|
|
|
|
cwd: "app"
|
|
|
|
src: ['coffee/*.coffee'],
|
|
|
|
dest: 'app/js/',
|
|
|
|
ext: '.js'
|
|
|
|
|
|
|
|
app:
|
|
|
|
src: "app.coffee"
|
|
|
|
dest: "app.js"
|
|
|
|
|
|
|
|
unit_tests:
|
|
|
|
expand: true
|
|
|
|
cwd: "test/unit/coffee"
|
|
|
|
src: ["**/*.coffee"]
|
|
|
|
dest: "test/unit/js/"
|
|
|
|
ext: ".js"
|
|
|
|
|
|
|
|
acceptance_tests:
|
|
|
|
expand: true
|
|
|
|
cwd: "test/acceptance/coffee"
|
|
|
|
src: ["**/*.coffee"]
|
|
|
|
dest: "test/acceptance/js/"
|
|
|
|
ext: ".js"
|
|
|
|
|
|
|
|
smoke_tests:
|
|
|
|
expand: true
|
|
|
|
cwd: "test/smoke/coffee"
|
|
|
|
src: ["**/*.coffee"]
|
|
|
|
dest: "test/smoke/js"
|
|
|
|
ext: ".js"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
app: ["app/js/"]
|
|
|
|
unit_tests: ["test/unit/js"]
|
|
|
|
acceptance_tests: ["test/acceptance/js"]
|
|
|
|
smoke_tests: ["test/smoke/js"]
|
|
|
|
|
|
|
|
execute:
|
|
|
|
app:
|
|
|
|
src: "app.js"
|
|
|
|
|
|
|
|
mochaTest:
|
|
|
|
unit:
|
|
|
|
options:
|
2014-04-29 07:31:30 -04:00
|
|
|
reporter: grunt.option('reporter') or 'spec'
|
2015-01-20 10:25:35 -05:00
|
|
|
grep: grunt.option("grep")
|
2014-04-28 11:45:59 -04:00
|
|
|
src: ["test/unit/js/**/*.js"]
|
|
|
|
acceptance:
|
|
|
|
options:
|
2014-04-29 07:31:30 -04:00
|
|
|
reporter: grunt.option('reporter') or 'spec'
|
2014-04-28 11:45:59 -04:00
|
|
|
timeout: 40000
|
|
|
|
grep: grunt.option("grep")
|
|
|
|
src: ["test/acceptance/js/**/*.js"]
|
|
|
|
smoke:
|
|
|
|
options:
|
2014-04-29 07:31:30 -04:00
|
|
|
reporter: grunt.option('reporter') or 'spec'
|
2014-04-28 11:45:59 -04:00
|
|
|
timeout: 10000
|
|
|
|
src: ["test/smoke/js/**/*.js"]
|
2016-11-28 11:51:43 -05:00
|
|
|
|
|
|
|
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'
|
2014-04-28 11:45:59 -04:00
|
|
|
|
|
|
|
grunt.loadNpmTasks 'grunt-contrib-coffee'
|
|
|
|
grunt.loadNpmTasks 'grunt-contrib-clean'
|
|
|
|
grunt.loadNpmTasks 'grunt-mocha-test'
|
|
|
|
grunt.loadNpmTasks 'grunt-shell'
|
|
|
|
grunt.loadNpmTasks 'grunt-execute'
|
|
|
|
grunt.loadNpmTasks 'grunt-bunyan'
|
2014-04-28 11:53:51 -04:00
|
|
|
grunt.loadNpmTasks 'grunt-forever'
|
2014-04-28 11:45:59 -04:00
|
|
|
|
2014-04-29 07:31:30 -04:00
|
|
|
grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src']
|
2014-04-28 11:45:59 -04:00
|
|
|
grunt.registerTask 'run', ['compile:app', 'bunyan', 'execute']
|
|
|
|
|
|
|
|
grunt.registerTask 'compile:unit_tests', ['clean:unit_tests', 'coffee:unit_tests']
|
|
|
|
grunt.registerTask 'test:unit', ['compile:app', 'compile:unit_tests', 'mochaTest:unit']
|
|
|
|
|
|
|
|
grunt.registerTask 'compile:acceptance_tests', ['clean:acceptance_tests', 'coffee:acceptance_tests']
|
|
|
|
grunt.registerTask 'test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']
|
|
|
|
|
|
|
|
grunt.registerTask 'compile:smoke_tests', ['clean:smoke_tests', 'coffee:smoke_tests']
|
|
|
|
grunt.registerTask 'test:smoke', ['compile:smoke_tests', 'mochaTest:smoke']
|
|
|
|
|
|
|
|
grunt.registerTask 'install', 'compile:app'
|
2016-11-28 11:51:43 -05:00
|
|
|
|
|
|
|
grunt.registerTask 'test:acceptance:docker', ['compile:acceptance_tests', 'shell:dockerTests']
|
2014-04-28 11:45:59 -04:00
|
|
|
|
|
|
|
grunt.registerTask 'default', ['run']
|
|
|
|
|
|
|
|
|