Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
add more debug output for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Oct 28, 2016
1 parent 4e72603 commit bd6cd95
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
env:
DOCKER_COMPOSE_VERSION: 1.8.0
CXX: g++-4.8
DEBUG: crater-util:kill,crater-util:kill:ps,crater:shutdown

addons:
apt:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dependencies": {
"babel-runtime": "^6.11.6",
"bcrypt": "^0.8.7",
"debug": "^2.2.0",
"es6-promisify": "^4.1.0",
"express": "^4.14.0",
"immutable": "^3.8.1",
Expand Down Expand Up @@ -65,7 +66,7 @@
"babel-register": "^6.14.0",
"chai": "^3.5.0",
"coveralls": "^2.11.14",
"crater-util": "^1.1.3",
"crater-util": "^1.1.5",
"cross-spawn": "^4.0.0",
"css-loader": "^0.24.0",
"dotenv": "^2.0.0",
Expand Down
13 changes: 13 additions & 0 deletions scripts/devServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import express from 'express'
import webpackConfig from '../webpack/webpack.config.dev'
import createDebug from 'debug'

const shutdownDebug = createDebug('crater:shutdown')

if (process.env.USE_DOTENV) require('dotenv').config()
const {PORT} = process.env
Expand All @@ -25,3 +28,13 @@ const server = app.listen(webpackConfig.devServer.port)
server.on('upgrade', (req: Object, socket: any, head: any): any => proxy.ws(req, socket, head, { target }))

console.log(`Dev server is listening on http://0.0.0.0:${webpackConfig.devServer.port}`)

function shutdown() {
shutdownDebug('got signal, shutting down')
server.stop()
process.exit(0)
}

process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)

14 changes: 12 additions & 2 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import express from 'express'
import path from 'path'
import createSSR from './createSSR'
import { WebApp } from 'meteor/webapp'
import createDebug from 'debug'

const shutdownDebug = createDebug('crater:shutdown')

import '../universal/collections/Counts'

Expand Down Expand Up @@ -35,5 +38,12 @@ WebApp.rawConnectHandlers.use(app)

console.log(`App is listening on http://0.0.0.0:${process.env.PORT || '80'}`) // eslint-disable-line no-console

process.on('SIGINT', (): any => process.exit(0))
process.on('SIGTERM', (): any => process.exit(0))
function shutdown() {
shutdownDebug('got signal, shutting down')
WebApp.httpServer.stop()
process.exit(0)
}

process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)

2 changes: 1 addition & 1 deletion test/integration/integrationTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ describe('prod mode with DISABLE_FULL_SSR=1', function () {

after(async function () {
this.timeout(30000)
if (process.env.BABEL_ENV === 'coverage') await mergeClientCoverage()
if (server) await kill(server, 'SIGINT')
if (process.env.BABEL_ENV === 'coverage') await mergeClientCoverage()
})
})

Expand Down

0 comments on commit bd6cd95

Please sign in to comment.