From e73b5389fdbf924cc00b271f81b37f3e3f3f85c0 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Tue, 12 Apr 2016 14:39:00 +0200 Subject: [PATCH] Fix unittest adapters --- lib/junit_adapter.rb | 2 +- lib/py_unit_adapter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/junit_adapter.rb b/lib/junit_adapter.rb index 87b70d84..c5b57184 100644 --- a/lib/junit_adapter.rb +++ b/lib/junit_adapter.rb @@ -2,7 +2,7 @@ class JunitAdapter < TestingFrameworkAdapter COUNT_REGEXP = /Tests run: (\d+)/ FAILURES_REGEXP = /Failures: (\d+)/ SUCCESS_REGEXP = /OK \((\d+) test[s]?\)/ - ASSERTION_ERROR_REGEXP = /java\.lang\.AssertionError:\s(.*)/ + ASSERTION_ERROR_REGEXP = /java\.lang\.AssertionError:\s(.​*)|org\.junit\.ComparisonFailure:\s(.*​)/ def self.framework_name 'JUnit' diff --git a/lib/py_unit_adapter.rb b/lib/py_unit_adapter.rb index 68cdd200..f7f98dae 100644 --- a/lib/py_unit_adapter.rb +++ b/lib/py_unit_adapter.rb @@ -11,7 +11,7 @@ class PyUnitAdapter < TestingFrameworkAdapter count = COUNT_REGEXP.match(output[:stderr]).captures.first.to_i matches = FAILURES_REGEXP.match(output[:stderr]) failed = matches ? matches.captures.try(:first).to_i : 0 - error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).captures + error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).try(:captures) || [] {count: count, failed: failed, error_messages: error_matches} end end