fastlane-plugin-firebase_test_lab_android 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 883eb15ea0a6623c3141ffa9b55980ade6c1ea99f04f7f6227d8d6ce17553265
4
- data.tar.gz: f6b4d25a278cef94b40bd6cba2816ae458ca8d31a8c6ae6452c4a12443088b77
3
+ metadata.gz: df8aeae7794db5b23673eb910a96f9c1e8308d65e9d9f9beac948dc7905516bf
4
+ data.tar.gz: b6cca85ac8c9ad7daa58437e2d297c32c1fde37c14435241252208d4c3ae16a9
5
5
  SHA512:
6
- metadata.gz: 3d20c91d8eabb41bcf8fddeeb36db466a06f11f291bc58d9507aa3b79b07f0c394eefae05b6f08c28fa77b25815b3723ccf925385f99782201767f6397fccfa8
7
- data.tar.gz: 6a5e3866ebe692cc08a7c2bfeee103d774a16da7c70713dc8ad6999ba5b5b5b10b2e43a5af3c26f5f4f38d09efbac67b1404c0063996f3364afc0886bb9cd26b
6
+ metadata.gz: 6037e16d9489ff0a302535f25adec5588ce7feee2268e8f78498185d96113169b29091955b37ac462965ba9eb82c2277e673782b725db0d6d1f67a6117b35682
7
+ data.tar.gz: 0607f39a00764fc0b0700179c52d9d98a4d286f475931aa6526980e612024d3897b273cdf07676654149831a6ce1df3d09e2d4ca12f568a7e191904b9873315c
data/README.md CHANGED
@@ -162,7 +162,8 @@ lane :test do
162
162
  github_owner: "******", # Owner name.
163
163
  github_repository: "************", # Repository name.
164
164
  github_pr_number: pr_number, # If you using run on CI that need pull request number for auto comment.
165
- github_api_token: ENV["GITHUB_API_TOKEN"] # https://github.com/settings/tokens
165
+ github_api_token: ENV["GITHUB_API_TOKEN"], # https://github.com/settings/tokens
166
+ download_dir: ".results" # If you want to download to the results of Firebase test lab.
166
167
  )
167
168
  end
168
169
  ```
@@ -43,9 +43,20 @@ module Fastlane
43
43
  # }
44
44
  # ]
45
45
  json = JSON.parse(File.read(params[:console_log_file_name]))
46
+ UI.message("Test status: #{json}")
47
+
48
+ # Fetch results
49
+ download_dir = params[:download_dir]
50
+ if download_dir
51
+ UI.message("Fetch results from Firebase Test Lab results bucket")
52
+ json.each do |status|
53
+ Helper.if_need_dir("#{download_dir}/#{status["axis_value"]}")
54
+ Action.sh("gsutil -m cp -r gs://#{results_bucket}/#{results_dir}/#{status["axis_value"]} #{download_dir}")
55
+ end
56
+ end
46
57
 
47
58
  # Notify to Slack
48
- if params[:slack_url] != nil
59
+ if params[:slack_url]
49
60
  success, body = Helper.make_slack_text(json)
50
61
  SlackNotifier.notify(params[:slack_url], body, success)
51
62
  end
@@ -55,7 +66,7 @@ module Fastlane
55
66
  repository = params[:github_repository]
56
67
  pr_number = params[:github_pr_number]
57
68
  api_token = params[:github_api_token]
58
- unless owner.nil? || repository.nil? || pr_number.nil? || api_token.nil?
69
+ if owner && repository && pr_number && api_token
59
70
  prefix, comment = Helper.make_github_text(json, params[:project_id], results_bucket, results_dir)
60
71
  # Delete past comments
61
72
  GitHubNotifier.delete_comments(owner, repository, pr_number, prefix, api_token)
@@ -201,6 +212,12 @@ module Fastlane
201
212
  description: "GitHub API Token",
202
213
  type: String,
203
214
  optional: true,
215
+ default_value: nil),
216
+ FastlaneCore::ConfigItem.new(key: :download_dir,
217
+ env_name: "DOWNLOAD_DIR",
218
+ description: "Target directory to download screenshots from firebase",
219
+ type: String,
220
+ optional: true,
204
221
  default_value: nil)
205
222
  ]
206
223
  end
@@ -34,7 +34,7 @@ module Fastlane
34
34
 
35
35
  def self.run_tests(arguments)
36
36
  UI.message("Test running...")
37
- Action.sh("gcloud firebase test android run #{arguments}")
37
+ Action.sh("set +e; gcloud firebase test android run #{arguments}; set -e")
38
38
  end
39
39
 
40
40
  def self.is_failure(outcome)
@@ -50,7 +50,7 @@ module Fastlane
50
50
  path
51
51
  end
52
52
 
53
- def self.format_device_name(axis_value)
53
+ def self.split_device_name(axis_value)
54
54
  # Sample Nexus6P-23-ja_JP-portrait
55
55
  array = axis_value.split("-")
56
56
  "#{array[0]} (API #{array[1]})"
@@ -89,7 +89,7 @@ module Fastlane
89
89
  body = json.map { |status|
90
90
  outcome = status["outcome"]
91
91
  emoji = emoji_status(outcome)
92
- device = format_device_name(status["axis_value"])
92
+ device = split_device_name(status["axis_value"])
93
93
  "#{device}: #{emoji} #{outcome}\n"
94
94
  }.inject(&:+)
95
95
  return success, body
@@ -99,7 +99,7 @@ module Fastlane
99
99
  prefix = "<img src=\"https://github.com/cats-oss/fastlane-plugin-firebase_test_lab_android/blob/master/art/firebase_test_lab_logo.png?raw=true\" width=\"65%\" loading=\"lazy\" />"
100
100
  cells = json.map { |data|
101
101
  axis = data["axis_value"]
102
- device = format_device_name(axis)
102
+ device = split_device_name(axis)
103
103
  outcome = data["outcome"]
104
104
  status = "#{emoji_status(outcome)} #{outcome}"
105
105
  message = data["test_details"]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FirebaseTestLabAndroid
3
- VERSION = "0.2.4"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-firebase_test_lab_android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wasabeef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.116.0
131
+ version: 2.135.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 2.116.0
138
+ version: 2.135.2
139
139
  description:
140
140
  email: dadadada.chop@gmail.com
141
141
  executables: []