Skip to content

Commit

Permalink
feat: Printing some diagnostics from #625 by logging as a fast solution
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Oct 4, 2016
1 parent 2457061 commit 38edf15
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/configure-reporters.coffee
Expand Up @@ -21,7 +21,7 @@ configureReporters = (config, stats, tests, runner) ->

reporters = config.options.reporter
outputs = config.options.output
logger.debug('Configuring reporters:', reporters, outputs)
logger.verbose('Configuring reporters:', reporters, outputs)

addCli = (reporters) ->
if reporters.length > 0
Expand Down
18 changes: 17 additions & 1 deletion src/dredd-command.coffee
Expand Up @@ -5,6 +5,7 @@ fs = require 'fs'
os = require 'os'
spawnArgs = require 'spawn-args'
{spawn} = require('child_process')
execSync = require('sync-exec')

Dredd = require './dredd'
interactiveConfig = require './interactive-config'
Expand Down Expand Up @@ -268,6 +269,20 @@ class DreddCommand
@runDredd @dreddInstance
, waitMilis

# This should be handled in a better way in the future:
# https://github.com/apiaryio/dredd/issues/625
logDebuggingInfo: (config) ->
logger.debug('Dredd version:', packageData.version)
logger.debug('Node.js version:', process.version)
logger.debug('Node.js environment:', process.versions)
logger.debug('System version:', os.type(), os.release(), os.arch())
try
npmVersion = execSync('npm --version').stdout.trim()
logger.debug('npm version:', npmVersion or 'unable to determine npm version')
catch err
logger.debug('npm version: unable to determine npm version:', err)
logger.debug('Configuration:', JSON.stringify(config))

run: ->
for task in [
@setOptimistArgv
Expand All @@ -281,7 +296,8 @@ class DreddCommand
return if @finished

configurationForDredd = @initConfig()
@dreddInstance = @initDredd configurationForDredd
@logDebuggingInfo(configurationForDredd)
@dreddInstance = @initDredd(configurationForDredd)

try
@runServerAndThenDredd()
Expand Down

0 comments on commit 38edf15

Please sign in to comment.