Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

got teamcity report

  • Loading branch information...
commit 60b0727080537eea1427601bf41f2a534399adcd 1 parent 0817af4
@msuarz msuarz authored
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "frankendoc",
- "version": "0.2.1",
+ "version": "0.2.2",
"description" : "bringing documents alive",
"repository" : { "type" : "git", "url" : "https://github.com/limadelic/frankendoc.git" },
"keywords" : ["testing", "atdd", "bdd"],
View
7 src/frankendoc.coffee
@@ -15,14 +15,15 @@ class Frank
@classes.read @files.code
run:->
+ @report.start()
@read()
for doc in @files.docs
- @report.start doc.name
+ @report.running doc.name
results = @runner.run_steps @classes.new(), doc.steps
- @report.stop results
+ @report.finished results
- @report.totals()
+ @report.stop()
@frank = -> Fiber(-> new Frank().run()).run()
View
17 src/reports/console.coffee
@@ -2,10 +2,6 @@
class @Report
- constructor: ->
- @empty_line()
- @stats = new Stats
-
icons:
passed: ''
failed: ' x '
@@ -18,10 +14,14 @@ class @Report
color: (text) -> '\u001b[' + @colors[@status] + 'm' + text + '\u001b[0m'
- start: (@name) ->
+ start: ->
+ @empty_line()
+ @stats = new Stats
+
+ running: (@name) ->
@stats.start()
- stop: (@results) ->
+ finished: (@results) ->
return unless @results.length
@status = @stats.stop @results
@report_doc()
@@ -31,10 +31,9 @@ class @Report
console.log @color @icons[@status] + @name + ' (' + @stats.duration + 'ms)'
report_unsuccessful_steps: ->
- for result in @results when not result.passed
- console.log ' ' + result.step + ': ' + (result.message ? 'pending')
+ console.log ' ' + msg for msg in @stats.messages()
- totals: ->
+ stop: ->
@empty_line()
console.log(
@stats.docs + ' docs, ' +
View
4 src/reports/stats.coffee
@@ -23,6 +23,10 @@ class @Stats
return @status = 'failed' if result.failed
@status = 'pending'
+ messages: ->
+ for result in @results when not result.passed
+ result.step + ': ' + (result.message ? 'pending')
+
count: ->
@docs++
@[@status]++
View
30 src/reports/teamcity.coffee
@@ -0,0 +1,30 @@
+{ Stats } = require './stats'
+_ = require 'underscore'
+
+class @Report
+
+ suite_name: settings.name ? 'frankendoc'
+
+ start: ->
+ @stats = new Stats
+ @report "SuiteStarted name='#{@suite_name}'"
+
+ running: (@name) ->
+ @stats.start()
+ @report "Started name='#{@name}'"
+
+ finished: (@results) ->
+ return unless @results.length
+ @[@stats.stop @results]()
+
+ passed: -> @report "Finished name='#{@name}' duration='#{@stats.duration}'"
+ failed: -> @report "Failed name='#{@name}' message='#{@message()}'"
+ pending: -> @report "Ignored name='#{@name}' message'#{@message()}'"
+
+ message: -> _.escape @stats.messages().join '\n'
+
+ stop: ->
+ @report "SuiteFinished name='#{@suite_name}' duration='#{@stats.time}'"
+
+ report: (message) ->
+ console.log '##teamcity[test' + message + ']'
Please sign in to comment.
Something went wrong with that request. Please try again.