Skip to content

Commit

Permalink
Move server start-up to Gruntfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Aug 7, 2015
1 parent a286e4a commit f995107
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ node_js:
- 0.10
before_script:
- npm install -g grunt-cli
- node spec/utils/echoserver.js 3889 &
- node spec/utils/nofloserver.js 3892 &
sudo: false
17 changes: 15 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ module.exports = ->
connect:
server:
options:
port: 8000
port: 3000
#keepalive: true
mocha_phantomjs:
options:
reporter: 'spec'
all:
options:
urls: ['http://localhost:8000/spec/runner.html']
urls: ['http://127.0.0.1:3000/spec/runner.html']

# Coding standards
coffeelint:
Expand Down Expand Up @@ -91,6 +91,18 @@ module.exports = ->
@task.run 'noflo_browser'
@task.run 'uglify'

@registerTask 'start_servers', 'Start local WebSocket servers', ->
done = @async()
require('coffee-script/register');
utils = require './spec/utils/utils'
utils.createServer 3889, (err) =>
return @fail.fatal err if err
console.log "Echo server running at port 3889"
utils.createNoFloServer 3892, (err) =>
return @fail.fatal err if err
console.log "NoFlo server running at port 3892"
done()

@registerTask 'test', 'Build NoFlo and run automated tests', (target = 'all') =>
@task.run 'coffeelint'
@task.run 'coffee'
Expand All @@ -100,6 +112,7 @@ module.exports = ->
if target is 'all' or target is 'browser'
@task.run 'noflo_browser'
@task.run 'connect'
@task.run 'start_servers'
@task.run 'mocha_phantomjs'

@registerTask 'default', ['test']
6 changes: 0 additions & 6 deletions spec/utils/echoserver.js

This file was deleted.

6 changes: 0 additions & 6 deletions spec/utils/nofloserver.js

This file was deleted.

0 comments on commit f995107

Please sign in to comment.