2016-12-20 7 views
0

私のテスト用サンプル/テストコードを出力するダミーサーバが必要です。私はそのためにノードのhttpサーバーを使用し、node ./test/server.jsでスクリプトの前に起動します。Travisがサーバを起動してスクリプトを続ける

私はそれを始めることができますが、問題はそれがインスタンスを占有しているため、今すぐテストを実行できないということです。

質問がありますが、どうすればバックグラウンド/新しいインスタンスでサーバーを実行できますか? end_scriptでサーバーを停止するので、終了する必要はありません。

これは、これまで私のトラヴィス-configです:

language: node_js 
node_js: 
    - "6.1" 
cache: 
    directories: 
    — node_modules 
install: 
    - npm install 
before_script: 
    - sh -e node ./test/server.js 
script: 
    - ./node_modules/mocha-phantomjs/bin/mocha-phantomjs ./test/browser/jelly.html 
    - ./node_modules/mocha-phantomjs/bin/mocha-phantomjs ./test/browser/form.html 
    - ./node_modules/mocha/bin/mocha ./test/node/jelly.js 
after_script: 
    - curl http://localhost:5555/close 

答えて

3

あなたは&を付加することによって、バックグラウンドプロセスを行うことができます

before_script: 
    - node ./test/server.js & 
関連する問題