fastlane-plugin-stream_actions 0.3.12 → 0.3.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c73c04e5045faac03b3b1f26223b28ad5dae5a90df3061877081f37b6fd91bc
4
- data.tar.gz: df4dd4f8eeff082936d12462d00eebad7448848b6c5a72606eb427a4c5fa2ae4
3
+ metadata.gz: e590801a23665170ef777a8f2edc02fdd1a906e389c746cf2d38e38a83fdd549
4
+ data.tar.gz: 423cd6c7cdd6d1332abf73db5742958a0e8ed96b567ac876ec82e0a5817c44e0
5
5
  SHA512:
6
- metadata.gz: ba945e29b576de44ec2d3817adda733455e5644eb2786adbabfa56da40a618be563f1a7586a3bee5b343ef16774ec1708cc5b45b454f09d5ba710c270fdc65ac
7
- data.tar.gz: 0b9472d3dd485bf1873b210e4f9058f1f1fd293883915e15a54890aa494717b1fa15b28d06a6f1e6fa33fbefa18b87930ff19203ff05efb31dce6332a823e2b0
6
+ metadata.gz: 7cadaaea43caa84ffade2b7588e853ab97972c61f0ed33f2ee21707ef34585f008db02b09c0954e5928f7a2bc2b9a8c3af9a31df84e77a60aebada42aef78f5c
7
+ data.tar.gz: f35416b73c287ae215a8f3f3e34738aa5ddcb299abc1a776b1a8c92a1a78c8119a49ca7860cc992749880330d159f19b64dbfe0c09f8cdd615e6b8d19ba0f92c
@@ -1,39 +1,27 @@
1
1
  module Fastlane
2
2
  module Actions
3
- class WaitAndroidEmuIdle < Action
3
+ class WaitAndroidEmuIdleAction < Action
4
4
  def self.run(params)
5
5
  start_time = Time.now
6
- load_threshold = 1.0
7
6
  UI.important("Start waiting until device is idle (#{Time.now})")
8
- adb_command = 'adb shell uptime | cut -d , -f 3 | cut -f 2 -d :'
9
- load = `#{adb_command}`.strip.to_f
10
-
11
- end_time = start_time + 1800
12
- while load > load_threshold && Time.now < end_time
13
- if load < 4
14
- `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" || echo`
15
- anr_package = `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//"`.strip
16
- unless anr_package.empty?
17
- UI.important("ANR on screen for: #{anr_package}. Restarting it.")
18
- begin
19
- `adb shell su 0 killall #{anr_package}`
20
- rescue StandardError => e
21
- UI.error(e)
22
- # Fallback to click if kill didn't work. This location is for a 1080x1920 screen
23
- `adb shell input tap 540 935 || echo`
24
- end
25
-
26
- if anr_package == 'com.android.systemui'
27
- `adb shell am start-service -n com.android.systemui/.SystemUIService || echo`
28
- end
29
- end
7
+ check_emu_uptime = 'adb shell uptime | cut -d , -f 3 | cut -f 2 -d :'
8
+ current_load_value = `#{check_emu_uptime}`.strip.to_f
9
+
10
+ end_time = start_time + params[:timeout]
11
+ while current_load_value > params[:load_threshold] && Time.now < end_time
12
+ not_responding_package = `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//"`.strip
13
+ if not_responding_package == 'com.android.systemui'
14
+ UI.important("Trying to dismiss not responding #{not_responding_package} dialog")
15
+ `adb shell input keyevent KEYCODE_ENTER`
16
+ `adb shell input keyevent KEYCODE_DPAD_DOWN`
17
+ `adb shell input keyevent KEYCODE_ENTER`
30
18
  end
31
19
 
32
20
  sleep(10)
33
- load = `#{adb_command}`.strip.to_f
21
+ current_load_value = `#{check_emu_uptime}`.strip.to_f
34
22
  end
35
23
 
36
- UI.important('Reached timeout before device is idle 😕') if load > load_threshold
24
+ UI.important('Reached timeout before device is idle 😕') if current_load_value > params[:load_threshold]
37
25
  UI.important("Waited until device is idle for #{(Time.now - start_time).to_i} seconds ⌛️")
38
26
  end
39
27
 
@@ -46,7 +34,20 @@ module Fastlane
46
34
  end
47
35
 
48
36
  def self.available_options
49
- []
37
+ [
38
+ FastlaneCore::ConfigItem.new(
39
+ key: :load_threshold,
40
+ description: 'Load threshold to consider device idle',
41
+ is_string: false,
42
+ default_value: 1.0
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :timeout,
46
+ description: 'Timeout in seconds to wait for device to be idle',
47
+ is_string: false,
48
+ default_value: 1000
49
+ )
50
+ ]
50
51
  end
51
52
 
52
53
  def self.supported?(_platform)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.12'
3
+ VERSION = '0.3.14'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list