|
216 | 216 | end
|
217 | 217 |
|
218 | 218 | it "uses the file path instead of classname for annotation content when specified" do
|
219 |
| - output, status = Open3.capture2e("env", "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT=file", "#{__dir__}/../bin/annotate", "#{__dir__}/test-failure-and-error/") |
| 219 | + output, status = Open3.capture2e("env", "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT=file", "#{__dir__}/../bin/annotate", "#{__dir__}/test-failure-and-error/") |
220 | 220 |
|
221 |
| - assert_equal <<~OUTPUT, output |
222 |
| - Parsing junit-1.xml |
223 |
| - Parsing junit-2.xml |
224 |
| - Parsing junit-3.xml |
225 |
| - --- ❓ Checking failures |
226 |
| - There are 4 failures/errors 😭 |
227 |
| - --- ✍️ Preparing annotation |
228 |
| - 2 failures and 2 errors: |
| 221 | + assert_equal <<~OUTPUT, output |
| 222 | + Parsing junit-1.xml |
| 223 | + Parsing junit-2.xml |
| 224 | + Parsing junit-3.xml |
| 225 | + --- ❓ Checking failures |
| 226 | + There are 4 failures/errors 😭 |
| 227 | + --- ✍️ Preparing annotation |
| 228 | + 2 failures and 2 errors: |
229 | 229 |
|
230 |
| - <details> |
231 |
| - <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in ./spec/models/account_spec.rb</code></summary> |
| 230 | + <details> |
| 231 | + <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in ./spec/models/account_spec.rb</code></summary> |
232 | 232 |
|
233 |
| - <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
| 233 | + <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
234 | 234 |
|
235 |
| - expected: 250 |
236 |
| - got: 500 |
| 235 | + expected: 250 |
| 236 | + got: 500 |
237 | 237 |
|
238 |
| - (compared using eql?) |
239 |
| - ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
240 |
| - ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
241 |
| - ./spec/support/log.rb:17:in `run' |
242 |
| - ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
| 238 | + (compared using eql?) |
| 239 | + ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
| 240 | + ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
| 241 | + ./spec/support/log.rb:17:in `run' |
| 242 | + ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
243 | 243 |
|
244 |
| - in <a href="#1">Job #1</a> |
245 |
| - </details> |
| 244 | + in <a href="#1">Job #1</a> |
| 245 | + </details> |
246 | 246 |
|
247 |
| - <details> |
248 |
| - <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in ./spec/models/account_spec.rb</code></summary> |
| 247 | + <details> |
| 248 | + <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in ./spec/models/account_spec.rb</code></summary> |
249 | 249 |
|
250 |
| - <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
| 250 | + <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
251 | 251 |
|
252 |
| - expected: 700 |
253 |
| - got: 500 |
| 252 | + expected: 700 |
| 253 | + got: 500 |
254 | 254 |
|
255 |
| - (compared using eql?) |
256 |
| - ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
257 |
| - ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
258 |
| - ./spec/support/log.rb:17:in `run' |
259 |
| - ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
| 255 | + (compared using eql?) |
| 256 | + ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
| 257 | + ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
| 258 | + ./spec/support/log.rb:17:in `run' |
| 259 | + ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
260 | 260 |
|
261 |
| - in <a href="#2">Job #2</a> |
262 |
| - </details> |
| 261 | + in <a href="#2">Job #2</a> |
| 262 | + </details> |
263 | 263 |
|
264 |
| - <details> |
265 |
| - <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in ./spec/models/account_spec.rb</code></summary> |
| 264 | + <details> |
| 265 | + <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in ./spec/models/account_spec.rb</code></summary> |
266 | 266 |
|
267 |
| - <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
| 267 | + <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
268 | 268 |
|
269 |
| - expected: 700 |
270 |
| - got: 500 |
| 269 | + expected: 700 |
| 270 | + got: 500 |
| 271 | +
|
| 272 | + (compared using eql?) |
| 273 | + ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
| 274 | + ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
| 275 | + ./spec/support/log.rb:17:in `run' |
| 276 | + ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
271 | 277 |
|
272 |
| - (compared using eql?) |
273 |
| - ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
274 |
| - ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
275 |
| - ./spec/support/log.rb:17:in `run' |
276 |
| - ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
| 278 | + in <a href="#3">Job #3</a> |
| 279 | + </details> |
277 | 280 |
|
278 |
| - in <a href="#3">Job #3</a> |
279 |
| - </details> |
| 281 | + <details> |
| 282 | + <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in ./spec/models/account_spec.rb</code></summary> |
280 | 283 |
|
281 |
| - <details> |
282 |
| - <summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in ./spec/models/account_spec.rb</code></summary> |
| 284 | + <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
283 | 285 |
|
284 |
| - <code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250) |
| 286 | + expected: 250 |
| 287 | + got: 500 |
285 | 288 |
|
286 |
| - expected: 250 |
287 |
| - got: 500 |
| 289 | + (compared using eql?) |
| 290 | + ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
| 291 | + ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
| 292 | + ./spec/support/log.rb:17:in `run' |
| 293 | + ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
288 | 294 |
|
289 |
| - (compared using eql?) |
290 |
| - ./spec/models/account_spec.rb:78:in `block (3 levels) in <top (required)>' |
291 |
| - ./spec/support/database.rb:16:in `block (2 levels) in <top (required)>' |
292 |
| - ./spec/support/log.rb:17:in `run' |
293 |
| - ./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code> |
| 295 | + in <a href="#3">Job #3</a> |
| 296 | + </details> |
| 297 | + OUTPUT |
294 | 298 |
|
295 |
| - in <a href="#3">Job #3</a> |
296 |
| - </details> |
297 |
| - OUTPUT |
| 299 | + assert_equal 0, status.exitstatus |
| 300 | + end |
298 | 301 |
|
299 |
| - assert_equal 0, status.exitstatus |
300 |
| - end |
| 302 | + it "raises an error when an invalid failure-format is provided" do |
| 303 | + output, status = Open3.capture2e("env", "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT=kittens", "#{__dir__}/../bin/annotate", "#{__dir__}/test-failure-and-error/") |
| 304 | + assert_equal false, status.success? |
| 305 | + end |
301 | 306 |
|
302 | 307 | it "handles failures across multiple files in sub dirs" do
|
303 | 308 | output, status = Open3.capture2e("#{__dir__}/../bin/annotate", "#{__dir__}/tests-in-sub-dirs/")
|
|
0 commit comments