File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ class RSpecCustomFormatter < RSpec ::Core ::Formatters ::JsonFormatter
19
+ RSpec ::Core ::Formatters . register self
20
+
21
+ LOGFILE = File . new ( "tmp/rspec-#{ ENV [ 'TEST_SUITE' ] } -#{ RUBY_VERSION } .log" , 'w' )
22
+
23
+ def close ( _notification )
24
+ @output_hash [ :examples ] . map do |example |
25
+ regexp = /\S +\/ \S +/
26
+ filename = example [ :full_description ] . match ( /\S +\/ \S +/ ) [ 0 ]
27
+ log = "#{ filename } | #{ example [ :status ] } | #{ example [ :run_time ] } | #{ example [ :full_description ] } \n "
28
+ File . write ( LOGFILE , log , mode : 'a' )
29
+ end
30
+ end
31
+ end
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ def self.included(context)
64
64
else
65
65
config . add_formatter ( 'RSpec::Core::Formatters::HtmlFormatter' , "tmp/elasticsearch-#{ ENV [ 'TEST_SUITE' ] } -#{ RUBY_VERSION } .html" )
66
66
end
67
+ if ENV [ 'BUILDKITE' ]
68
+ require_relative "./rspec_formatter.rb"
69
+ config . add_formatter ( 'RSpecCustomFormatter' )
70
+ end
67
71
config . color_mode = :on
68
72
end
69
73
You can’t perform that action at this time.
0 commit comments