Class: Fastlane::Actions::ForsisAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/forsis/actions/forsis_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



18
19
20
# File 'lib/fastlane/plugin/forsis/actions/forsis_action.rb', line 18

def self.authors
  ["Azadeh Bagheri"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fastlane/plugin/forsis/actions/forsis_action.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :junit_report_file,
      env_name: "forsis_JUNIT_REPORT",
      description: "The path of the junit test report file used to generate the generic test execution file for sonarqube ",
      optional: false,
      type: String,
      display_in_shell: false,
      verify_block: proc do |path|
        if path == ""
          UI.user_error!("'forsis' action missing the key 'junit_report_path' or its value.")
        else
          UI.user_error!("ERROR: junit report not found at path: #{path}") unless File.exist?(path)
        end
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :sonar_report_directory,
      env_name: "forsis_SONAR_GENERATED_REPORT",
      description: "The path of the sonarqube test execution report generated from the junit test report",
      optional: true,
      default_value: './fastlane',
      type: String,
      verify_block: proc do |path|
        FileUtils.mkdir_p(path) unless File.directory?(path)
      end
    )
  ]
end

.descriptionObject



14
15
16
# File 'lib/fastlane/plugin/forsis/actions/forsis_action.rb', line 14

def self.description
  "This plugin produces generic test execution reports supported by SonarQube from JUnit test reports generated by fastlane"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
56
# File 'lib/fastlane/plugin/forsis/actions/forsis_action.rb', line 53

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
  true
end

.run(params) ⇒ Object



7
8
9
10
11
12
# File 'lib/fastlane/plugin/forsis/actions/forsis_action.rb', line 7

def self.run(params)
  junit_report_path = params[:junit_report_file]
  sonarqube_report_path = params[:sonar_report_directory]
  UI.message("Generating the Sonarqube generic test execution report!")
  Fastlane::Helper::ForsisHelper::Generator.generate(junit_report_path, sonarqube_report_path)
end