Sha256: 160eafbce977830c7a393f4c317f469cf9a5881d2abb87d67df8b275d1b5b116
Contents?: true
Size: 763 Bytes
Versions: 51
Compression:
Stored size: 763 Bytes
Contents
# frozen_string_literal: true require 'fileutils' module GitlabQuality module TestTooling module Report class IssueLogger def initialize(file_path:) @file_path = file_path @data = File.exist?(file_path) ? JSON.parse(File.read(file_path)) : Hash.new { |h, k| h[k] = [] } end def collect(test, issues) data[test.ci_job_url] += Array(issues).map(&:web_url) data[test.ci_job_url].uniq! end def write dirname = File.dirname(file_path) FileUtils.mkdir_p(dirname) unless File.directory?(dirname) File.write(file_path, JSON.pretty_generate(data)) end private attr_reader :file_path, :data end end end end
Version data entries
51 entries across 51 versions & 1 rubygems