fastlane-plugin-wpmreleasetoolkit 4.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_preflight.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +187 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb +279 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/firebase_login.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/removebranchprotection_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setbranchprotection_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_strings_files.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb +170 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb +95 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb +19 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_device.rb +62 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_lab_result.rb +36 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb +104 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit.rb +2 -2
- metadata +118 -81
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe6a0ccccfa972725f15898f4d1894e9ce81a8ee60b27c436d1930cd68b58a59
|
|
4
|
+
data.tar.gz: 7c25d05bd642b368cfe8eac93bb7e26db77dd8380f4665a2521b9b7c0191d7d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dd36004e4d5f45cb747bd5d005937deb36cf8a638aa556460e059dbbae823fac182bd1f6af849972c053ecef91e2e57c6bbf64d771014f973b07a0502f6897d
|
|
7
|
+
data.tar.gz: 9d719a9f9ca3281d6a5d6045040782df58552966f91a3042edaaaf0e98e4fcd9c3a7a2758fdb2af550d5bf3dd8ce0a4c3af92c6b367ca054b1d11971d8cc6275
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
require 'securerandom'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
module SharedValues
|
|
6
|
+
FIREBASE_TEST_RESULT = :FIREBASE_TEST_LOG_FILE
|
|
7
|
+
FIREBASE_TEST_LOG_FILE_PATH = :FIREBASE_TEST_LOG_FILE_PATH
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class AndroidFirebaseTestAction < Action
|
|
11
|
+
def self.run(params)
|
|
12
|
+
validate_options(params)
|
|
13
|
+
|
|
14
|
+
UI.user_error!('You must be logged in to Firebase prior to calling this action. Use the `FirebaseLogin` Action to log in if needed') unless Fastlane::FirebaseAccount.authenticated?
|
|
15
|
+
|
|
16
|
+
# Log in to Firebase (and validate credentials)
|
|
17
|
+
run_uuid = params[:test_run_id] || SecureRandom.uuid
|
|
18
|
+
test_dir = params[:results_output_dir] || File.join(Dir.tmpdir(), run_uuid)
|
|
19
|
+
|
|
20
|
+
# Set up the log file and output directory
|
|
21
|
+
FileUtils.mkdir_p(test_dir)
|
|
22
|
+
Fastlane::Actions.lane_context[:FIREBASE_TEST_LOG_FILE_PATH] = File.join(test_dir, 'output.log')
|
|
23
|
+
|
|
24
|
+
device = Fastlane::FirebaseDevice.new(
|
|
25
|
+
model: params[:model],
|
|
26
|
+
version: params[:version],
|
|
27
|
+
locale: params[:locale],
|
|
28
|
+
orientation: params[:orientation]
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
result = FirebaseTestRunner.run_tests(
|
|
32
|
+
project_id: params[:project_id],
|
|
33
|
+
apk_path: params[:apk_path],
|
|
34
|
+
test_apk_path: params[:test_apk_path],
|
|
35
|
+
device: device,
|
|
36
|
+
type: params[:type]
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# Download all of the outputs from the job to the local machine
|
|
40
|
+
FirebaseTestRunner.download_result_files(
|
|
41
|
+
result: result,
|
|
42
|
+
destination: test_dir,
|
|
43
|
+
project_id: params[:project_id],
|
|
44
|
+
key_file_path: params[:key_file]
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
FastlaneCore::UI.test_failure! "Firebase Tests failed – more information can be found at #{result.more_details_url}" unless result.success?
|
|
48
|
+
|
|
49
|
+
UI.success 'Firebase Tests Complete'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Fastlane doesn't eagerly validate options for us, so we'll do it first to have control over
|
|
53
|
+
# when they're evalutated.
|
|
54
|
+
def self.validate_options(params)
|
|
55
|
+
available_options
|
|
56
|
+
.reject { |opt| opt.optional || !opt.default_value.nil? }
|
|
57
|
+
.map(&:key)
|
|
58
|
+
.each { |k| params[k] }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#####################################################
|
|
62
|
+
# @!group Documentation
|
|
63
|
+
#####################################################
|
|
64
|
+
|
|
65
|
+
def self.description
|
|
66
|
+
'Runs the specified tests in Firebase Test Lab'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.details
|
|
70
|
+
description
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def self.available_options
|
|
74
|
+
[
|
|
75
|
+
FastlaneCore::ConfigItem.new(
|
|
76
|
+
key: :project_id,
|
|
77
|
+
# `env_name` comes from the Google Cloud default: https://cloud.google.com/functions/docs/configuring/env-var
|
|
78
|
+
env_name: 'GCP_PROJECT',
|
|
79
|
+
description: 'The Project ID to test in',
|
|
80
|
+
type: String
|
|
81
|
+
),
|
|
82
|
+
FastlaneCore::ConfigItem.new(
|
|
83
|
+
key: :key_file,
|
|
84
|
+
description: 'The key file used to authorize with Google Cloud',
|
|
85
|
+
type: String,
|
|
86
|
+
verify_block: proc do |value|
|
|
87
|
+
UI.user_error!('The `:key_file` parameter is required') if value.empty?
|
|
88
|
+
UI.user_error!("No Google Cloud Key file found at: #{value}") unless File.exist?(value)
|
|
89
|
+
end
|
|
90
|
+
),
|
|
91
|
+
FastlaneCore::ConfigItem.new(
|
|
92
|
+
key: :apk_path,
|
|
93
|
+
description: 'Path to the application APK on the local machine',
|
|
94
|
+
type: String,
|
|
95
|
+
verify_block: proc do |value|
|
|
96
|
+
UI.user_error!('The `:apk_path` parameter is required') if value.empty?
|
|
97
|
+
UI.user_error!("Invalid application APK: #{value}") unless File.exist?(value)
|
|
98
|
+
end
|
|
99
|
+
),
|
|
100
|
+
FastlaneCore::ConfigItem.new(
|
|
101
|
+
key: :test_apk_path,
|
|
102
|
+
description: 'Path to the test bundle APK on the local machine',
|
|
103
|
+
type: String,
|
|
104
|
+
verify_block: proc do |value|
|
|
105
|
+
UI.user_error!('The `:test_apk_path` parameter is required') if value.empty?
|
|
106
|
+
UI.user_error!("Invalid test APK: #{value}") unless File.exist?(value)
|
|
107
|
+
end
|
|
108
|
+
),
|
|
109
|
+
FastlaneCore::ConfigItem.new(
|
|
110
|
+
key: :model,
|
|
111
|
+
description: 'The device model to use to run the test',
|
|
112
|
+
type: String,
|
|
113
|
+
verify_block: proc do |value|
|
|
114
|
+
UI.user_error!('The `:model` parameter is required') if value.empty?
|
|
115
|
+
FirebaseTestRunner.verify_has_gcloud_binary!
|
|
116
|
+
model_names = Fastlane::FirebaseDevice.valid_model_names
|
|
117
|
+
UI.user_error!("Invalid Model Name: #{value}. Valid Model Names: #{model_names}") unless model_names.include?(value)
|
|
118
|
+
end
|
|
119
|
+
),
|
|
120
|
+
FastlaneCore::ConfigItem.new(
|
|
121
|
+
key: :version,
|
|
122
|
+
description: 'The Android version (API Level) to use to run the test',
|
|
123
|
+
type: Integer,
|
|
124
|
+
verify_block: proc do |value|
|
|
125
|
+
FirebaseTestRunner.verify_has_gcloud_binary!
|
|
126
|
+
version_numbers = Fastlane::FirebaseDevice.valid_version_numbers
|
|
127
|
+
UI.user_error!("Invalid Version Number: #{value}. Valid Version Numbers: #{version_numbers}") unless version_numbers.include?(value)
|
|
128
|
+
end
|
|
129
|
+
),
|
|
130
|
+
FastlaneCore::ConfigItem.new(
|
|
131
|
+
key: :locale,
|
|
132
|
+
description: 'The locale code to use when running the test',
|
|
133
|
+
type: String,
|
|
134
|
+
default_value: 'en',
|
|
135
|
+
verify_block: proc do |value|
|
|
136
|
+
FirebaseTestRunner.verify_has_gcloud_binary!
|
|
137
|
+
locale_codes = Fastlane::FirebaseDevice.valid_locales
|
|
138
|
+
UI.user_error!("Invalid Locale: #{value}. Valid Locales: #{locale_codes}") unless locale_codes.include?(value)
|
|
139
|
+
end
|
|
140
|
+
),
|
|
141
|
+
FastlaneCore::ConfigItem.new(
|
|
142
|
+
key: :orientation,
|
|
143
|
+
description: 'Which orientation to run the device in',
|
|
144
|
+
type: String,
|
|
145
|
+
default_value: 'portrait',
|
|
146
|
+
verify_block: proc do |value|
|
|
147
|
+
orientations = Fastlane::FirebaseDevice.valid_orientations
|
|
148
|
+
UI.user_error!("Invalid Orientation: #{value}. Valid Orientations: #{orientations}") unless orientations.include?(value)
|
|
149
|
+
end
|
|
150
|
+
),
|
|
151
|
+
FastlaneCore::ConfigItem.new(
|
|
152
|
+
key: :type,
|
|
153
|
+
description: 'The type of test to run (e.g. `instrumentation` or `robo`)',
|
|
154
|
+
type: String,
|
|
155
|
+
default_value: 'instrumentation',
|
|
156
|
+
verify_block: proc do |value|
|
|
157
|
+
types = Fastlane::FirebaseTestRunner::VALID_TEST_TYPES
|
|
158
|
+
UI.user_error!("Invalid Test Type: #{value}. Valid Types: #{types}") unless types.include?(value)
|
|
159
|
+
end
|
|
160
|
+
),
|
|
161
|
+
FastlaneCore::ConfigItem.new(
|
|
162
|
+
key: :test_run_id,
|
|
163
|
+
description: 'A unique ID used to identify this test run',
|
|
164
|
+
default_value_dynamic: true,
|
|
165
|
+
optional: true,
|
|
166
|
+
type: String
|
|
167
|
+
),
|
|
168
|
+
FastlaneCore::ConfigItem.new(
|
|
169
|
+
key: :results_output_dir,
|
|
170
|
+
description: 'The path to the folder where we will store the results of this test run',
|
|
171
|
+
default_value_dynamic: true,
|
|
172
|
+
optional: true,
|
|
173
|
+
type: String
|
|
174
|
+
),
|
|
175
|
+
]
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def self.authors
|
|
179
|
+
['Automattic']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def self.is_supported?(platform)
|
|
183
|
+
platform == :android
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|