Class: Publisher::ReportGenerator

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/allure_report_publisher/lib/report_generator.rb

Overview

Allure report generator

Instance Method Summary collapse

Methods included from Helpers

allure_cli?, colorize, debug_io, #env, error, execute_shell, log, log_debug, logger, pastel, path, reset_debug_io!

Constructor Details

#initialize(result_paths, report_name) ⇒ ReportGenerator

Returns a new instance of ReportGenerator.



13
14
15
16
# File 'lib/allure_report_publisher/lib/report_generator.rb', line 13

def initialize(result_paths, report_name)
  @result_paths = result_paths.join(" ")
  @report_name = report_name
end

Instance Method Details

#common_info_pathString Also known as: create_common_path

Common path for history and executor info

Returns:

  • (String)


30
31
32
33
34
# File 'lib/allure_report_publisher/lib/report_generator.rb', line 30

def common_info_path
  @common_info_path ||= Dir.mktmpdir("allure-results").tap do |path|
    log_debug("Created tmp folder for common data: '#{path}'")
  end
end

#generatevoid

This method returns an undefined value.

Generate allure report



21
22
23
24
25
# File 'lib/allure_report_publisher/lib/report_generator.rb', line 21

def generate
  create_common_path

  generate_report
end

#report_pathString

Allure report directory

Returns:

  • (String)


40
41
42
# File 'lib/allure_report_publisher/lib/report_generator.rb', line 40

def report_path
  @report_path ||= File.join(Dir.tmpdir, "allure-report-#{Time.now.to_i}")
end