Sha256: ab40b164bdc646cc29505e6bb38fd2adea28227dc42a494788827f868386fd3c
Contents?: true
Size: 1.06 KB
Versions: 8
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module GitlabQuality module TestTooling module TestResult class JUnitTestResult < BaseTestResult attr_accessor :testcase # Ignore it for now def name report['name'] end def file report['file'].delete_prefix('./') end def skipped? report.search('skipped').any? end def failures # rubocop:disable Metrics/AbcSize failures = report.search('failure') return [] if failures.empty? failures.map do |exception| trace = exception.content.split("\n").map(&:strip) spec_file_first_index = trace.rindex do |line| line.include?(File.basename(report['file'])) end exception['message'].gsub!(/(private_token=)[\w-]+/, '********') { 'message' => "#{exception['type']}: #{exception['message']}", 'stacktrace' => trace.slice(0..spec_file_first_index).join("\n") } end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems