fastlane-plugin-firebase_test_lab_android 0.3.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -51
- data/lib/fastlane/plugin/firebase_test_lab_android/actions/firebase_test_lab_android_action.rb +6 -3
- data/lib/fastlane/plugin/firebase_test_lab_android/helper/Helper.rb +14 -4
- data/lib/fastlane/plugin/firebase_test_lab_android/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 007572f3771342dc8f4e484fe891190468ea020c4d9afb43282a2e76a2345b48
|
4
|
+
data.tar.gz: 1f8b7e5e152d99867df4de3b8f59b611735c7b42698a4a4628c5dbe84b2c9037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75ebf588104c50c4921e8786a0d87de076aac9f851935f0d7836e640eaa908e38cf5d1ea7ff5b605afc4cbacb2af243ba12afc76dd20bbf5e22456f8a9cdd94
|
7
|
+
data.tar.gz: c1d69ddfab3926fdf572e52d5423b9e97e3dc9982c8b481e60d55c9499796ff63e4727bdfe45152334b34ec6c7a23f7e07193442b20b3d8ee0f645093f34468a
|
data/README.md
CHANGED
@@ -55,56 +55,7 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
|
|
55
55
|
fastlane add_plugin firebase_test_lab_android
|
56
56
|
```
|
57
57
|
|
58
|
-
### Step 3.
|
59
|
-
|
60
|
-
[Creating storage buckets](https://cloud.google.com/storage/docs/creating-buckets)
|
61
|
-
|
62
|
-
You will need the bucket name later in the Fastfile.
|
63
|
-
|
64
|
-
If you using the `gsutil`.
|
65
|
-
```s
|
66
|
-
gsutil mb gs://[BUCKET_NAME]/
|
67
|
-
```
|
68
|
-
```
|
69
|
-
# gsutil mb gs://firebase_cats_test_bucket
|
70
|
-
Creating gs://firebase_cats_test_bucket/...
|
71
|
-
```
|
72
|
-
|
73
|
-
|
74
|
-
### Step 4. Import existing Google Cloud Storage buckets to Firebase Storage
|
75
|
-
|
76
|
-
https://firebase.google.com/docs/storage
|
77
|
-
|
78
|
-
Import GCS bucket on Firebase console at Storage.
|
79
|
-
|
80
|
-
<img src="art/screenshot_firebase_storage_setup_bucket.png" width="75%" />
|
81
|
-
|
82
|
-
|
83
|
-
#### Step 4-2.
|
84
|
-
|
85
|
-
Edit the Firebase Security Rules on Firebase console.
|
86
|
-
|
87
|
-
<img src="art/screenshot_firebase_storage_rules.png" width="75%" />
|
88
|
-
|
89
|
-
This plugin need some match rules it `images` and `logcat` file for hyperlinks.
|
90
|
-
```
|
91
|
-
rules_version = '2';
|
92
|
-
service firebase.storage {
|
93
|
-
match /b/{bucket}/o {
|
94
|
-
match /{result_dir}/{device}/artifacts/{image} {
|
95
|
-
allow read: if image.matches(".*(jpeg|jpg|png)$")
|
96
|
-
}
|
97
|
-
match /{result_dir}/{device}/{file} {
|
98
|
-
allow read: if file.matches("logcat")
|
99
|
-
}
|
100
|
-
match /{allPaths=**} {
|
101
|
-
allow read, write: if request.auth != null;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
```
|
106
|
-
|
107
|
-
### Step 5. Find the devices you want to test on
|
58
|
+
### Step 3. Find the devices you want to test on
|
108
59
|
|
109
60
|
Using [gcloud tool](https://cloud.google.com/sdk/gcloud/), you can run.
|
110
61
|
|
@@ -117,7 +68,7 @@ to get a list of supported devices and their identifiers.
|
|
117
68
|
Alternatively all available devices can also be seen [here](https://firebase.google.com/docs/test-lab/ios/available-testing-devices).
|
118
69
|
|
119
70
|
|
120
|
-
### Step
|
71
|
+
### Step 4. Add settings to your Fastfile
|
121
72
|
|
122
73
|
Test your app with Firebase Test Lab with ease using fastlane.
|
123
74
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin.
|
data/lib/fastlane/plugin/firebase_test_lab_android/actions/firebase_test_lab_android_action.rb
CHANGED
@@ -50,8 +50,10 @@ module Fastlane
|
|
50
50
|
if download_dir
|
51
51
|
UI.message("Fetch results from Firebase Test Lab results bucket")
|
52
52
|
json.each do |status|
|
53
|
-
|
54
|
-
|
53
|
+
axis = status["axis_value"]
|
54
|
+
Helper.if_need_dir("#{download_dir}/#{axis}")
|
55
|
+
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
56
|
+
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
@@ -277,7 +279,8 @@ module Fastlane
|
|
277
279
|
github_owner: "cats-oss",
|
278
280
|
github_repository: "fastlane-plugin-firebase_test_lab_android",
|
279
281
|
github_pr_number: pr_number,
|
280
|
-
github_api_token: ENV["DANGER_GITHUB_API_TOKEN"]
|
282
|
+
github_api_token: ENV["DANGER_GITHUB_API_TOKEN"],
|
283
|
+
download_dir: ".results"
|
281
284
|
)
|
282
285
|
end']
|
283
286
|
end
|
@@ -14,8 +14,8 @@ module Fastlane
|
|
14
14
|
"https://console.developers.google.com/storage/browser/#{bucket}/#{CGI.escape(dir)}"
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.
|
18
|
-
"https://
|
17
|
+
def self.gcs_object_url(bucket, path)
|
18
|
+
"https://storage.googleapis.com/#{bucket}/#{CGI.escape(path)}"
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.firebase_test_lab_histories_url(project_id)
|
@@ -37,6 +37,16 @@ module Fastlane
|
|
37
37
|
Action.sh("set +e; gcloud firebase test android run #{arguments}; set -e")
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.copy_from_gcs(bucket_and_path, copy_to)
|
41
|
+
UI.message("Copy from gs://#{bucket_and_path}")
|
42
|
+
Action.sh("gsutil -m cp -r gs://#{bucket_and_path} #{copy_to}")
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.set_public(bucket_and_path)
|
46
|
+
UI.message("Set public for reading gs://#{bucket_and_path}")
|
47
|
+
Action.sh("gsutil -m acl -r set public-read gs://#{bucket_and_path}")
|
48
|
+
end
|
49
|
+
|
40
50
|
def self.is_failure(outcome)
|
41
51
|
outcome == FAILED || outcome == INCONCLUSIVE
|
42
52
|
end
|
@@ -103,9 +113,9 @@ module Fastlane
|
|
103
113
|
outcome = data["outcome"]
|
104
114
|
status = "#{emoji_status(outcome)} #{outcome}"
|
105
115
|
message = data["test_details"]
|
106
|
-
logcat = "<a href=\"#{
|
116
|
+
logcat = "<a href=\"#{gcs_object_url(bucket, "#{dir}/#{axis}/logcat")}\" target=\"_blank\" >#{random_emoji_cat}</a>"
|
107
117
|
if test_type == "robo"
|
108
|
-
sitemp = "<img src=\"#{
|
118
|
+
sitemp = "<img src=\"#{gcs_object_url(bucket, "#{dir}/#{axis}/artifacts/sitemap.png")}\" height=\"64px\" loading=\"lazy\" target=\"_blank\" />"
|
109
119
|
else
|
110
120
|
sitemp = "--"
|
111
121
|
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.
|
4
|
+
version: 1.0.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-
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|