Class: TeamCityFormatter

Inherits:
XCPretty::Simple
  • Object
show all
Defined in:
lib/teamcity_formatter.rb

Instance Method Summary collapse

Instance Method Details

#format_build_target(target, project, configuration) ⇒ Object



57
58
59
# File 'lib/teamcity_formatter.rb', line 57

def format_build_target(target, project, configuration)
  "##teamcity[progressMessage 'Building #{target}']"
end

#format_check_dependenciesObject



53
54
55
# File 'lib/teamcity_formatter.rb', line 53

def format_check_dependencies()
  "##teamcity[progressMessage 'Check dependencies']"
end

#format_compile(file_name, file_path) ⇒ Object



61
62
63
# File 'lib/teamcity_formatter.rb', line 61

def format_compile(file_name, file_path)
  "##teamcity[progressMessage 'Compiling #{file_name}'"
end

#format_error(message) ⇒ Object



43
44
45
# File 'lib/teamcity_formatter.rb', line 43

def format_error(message)
  "##teamcity[testStdErr name='className.testName' out='#{message}']"
end

#format_failing_test(suite, test, time, file_path) ⇒ Object



47
48
49
50
51
# File 'lib/teamcity_formatter.rb', line 47

def format_failing_test(suite, test, time, file_path)
  "##teamcity[testStarted name='#{test}']\n" +
      "##teamcity[testFailed name='#{test}' message='#{time}']\n" +
      "##teamcity[testFinished name='#{test}']"
end

#format_passing_test(suite, test, time) ⇒ Object



38
39
40
41
# File 'lib/teamcity_formatter.rb', line 38

def format_passing_test(suite, test, time)
  "##teamcity[testStarted name='#{test}']\n" +
      "##teamcity[testFinished name='#{test}' duration='#{time}']"
end

#format_phase_success(phase_name) ⇒ Object



69
70
71
# File 'lib/teamcity_formatter.rb', line 69

def format_phase_success(phase_name)
  "##teamcity[progressMessage '#{phase_name} Success'"
end

#format_test_run_finished(name, time) ⇒ Object

Used to signal a test target is complete



11
12
13
14
15
16
17
18
19
20
# File 'lib/teamcity_formatter.rb', line 11

def format_test_run_finished(name, time)

  if @previousSuite != nil
    # Close the last test suite before the target is complete
    testSuiteFinished(@previousSuite)
    @previousSuite = nil
  end

  "##teamcity[testSuiteFinished name='#{name}']"
end

#format_test_run_started(name) ⇒ Object

Used when opening a test target For example: Test Suite 'Unit Tests.xctest' started at ...



6
7
8
# File 'lib/teamcity_formatter.rb', line 6

def format_test_run_started(name)
  "##teamcity[testSuiteStarted name='#{name}']"
end

#format_test_suite_started(name) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/teamcity_formatter.rb', line 22

def format_test_suite_started(name)
  #Skip the All tests, which comes first
  return "" if name == 'All tests'

  if @previousSuite != nil
     testSuiteFinished(@previousSuite)
  end

  @previousSuite = name
  "##teamcity[testSuiteStarted name='#{name}']"
end

#format_touch(file_path, file_name) ⇒ Object



65
66
67
# File 'lib/teamcity_formatter.rb', line 65

def format_touch(file_path, file_name)
  "##teamcity[progressMessage 'Touching #{file_name}'"
end

#testSuiteFinished(name) ⇒ Object



34
35
36
# File 'lib/teamcity_formatter.rb', line 34

def testSuiteFinished(name)
  puts "##teamcity[testSuiteFinished name='#{@previousSuite}']"
end