fastlane-plugin-instrumented_tests 0.1.0 → 0.1.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85f9b58e24abc1295eca1af888789dc922c73d2d
|
4
|
+
data.tar.gz: 3fef50aa36cb239263fec444da4162652fb5d984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f835bf89786381419422ef3895e28a27721237c08b8a3808a994de2ac4844397dc17a0c380d3fe4e5aba810e04d00d936712b5500ed1b2183c71e3f15f6b80ec
|
7
|
+
data.tar.gz: 5c6b0d709dcb145fb48f9c1698d75038dabed3975146ffa0e7fb68384167f67111838820d07d4c386605a566753b065690db25bf77b6d2f583fa1a667dd768bc
|
data/README.md
CHANGED
@@ -43,6 +43,11 @@ To automatically fix many of the styling issues, use
|
|
43
43
|
rubocop -a
|
44
44
|
```
|
45
45
|
|
46
|
+
## Other notes
|
47
|
+
|
48
|
+
Found while searching for this type of plugin, https://github.com/fastlane/fastlane/pull/4315 https://github.com/joshrlesch/fastlane/tree/fastlane-instrument-tests
|
49
|
+
Changed to plugin infrastructure.
|
50
|
+
|
46
51
|
## Issues and Feedback
|
47
52
|
|
48
53
|
For any other issues and feedback about this plugin, please submit it to this repository.
|
@@ -8,7 +8,6 @@ module Fastlane
|
|
8
8
|
|
9
9
|
class InstrumentedTestsAction < Action
|
10
10
|
def self.run(params)
|
11
|
-
gradle = Helper::GradleHelper.new(gradle_path: Dir["./gradlew"].last)
|
12
11
|
file = Tempfile.new('emulator_output')
|
13
12
|
|
14
13
|
# Set up params
|
@@ -26,21 +25,21 @@ module Fastlane
|
|
26
25
|
Action.sh("#{params[:sdk_path]}/tools/android delete avd -n #{params[:avd_name]}")
|
27
26
|
end
|
28
27
|
|
29
|
-
|
28
|
+
UI.important("Creating AVD...")
|
30
29
|
Action.sh(create_avd)
|
31
30
|
|
32
|
-
|
31
|
+
UI.important("Starting AVD...")
|
33
32
|
begin
|
34
33
|
Action.sh(start_avd)
|
35
34
|
|
36
35
|
# Wait for device to be fully
|
37
|
-
boot_emulator
|
36
|
+
boot_emulator(params)
|
38
37
|
|
39
|
-
Helper.log.info("Executing gradle command...".green)
|
40
38
|
begin
|
41
|
-
|
39
|
+
Fastlane::Actions::GradleAction.run(task: params[:task], flags: params[:flags], project_dir: params[:project_dir],
|
40
|
+
print_command: true, print_command_output: true)
|
42
41
|
ensure
|
43
|
-
stop_emulator
|
42
|
+
stop_emulator(params, file)
|
44
43
|
end
|
45
44
|
ensure
|
46
45
|
file.close
|
@@ -48,34 +47,34 @@ module Fastlane
|
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
51
|
-
def self.boot_emulator
|
52
|
-
|
50
|
+
def self.boot_emulator(params)
|
51
|
+
UI.important("Waiting for emulator to finish booting... May take a few minutes...")
|
53
52
|
loop do
|
54
|
-
|
53
|
+
bootCompletedCommand = "#{params[:sdk_path]}/platform-tools/adb shell getprop sys.boot_completed"
|
54
|
+
stdout, _stdeerr, _status = Open3.capture3(bootCompletedCommand)
|
55
55
|
|
56
56
|
if stdout.strip == "1"
|
57
|
-
|
57
|
+
UI.success("Emulator Booted!")
|
58
58
|
break
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
def self.stop_emulator
|
63
|
+
def self.stop_emulator(params, file)
|
64
|
+
UI.important("Shutting down emulator...")
|
64
65
|
adb = Helper::AdbHelper.new(adb_path: "#{params[:sdk_path]}/platform-tools/adb")
|
65
66
|
temp = File.open(file.path).read
|
66
67
|
port = temp.match(/console on port (\d+),/)
|
67
|
-
|
68
68
|
if port
|
69
69
|
port = port[1]
|
70
70
|
else
|
71
|
-
|
71
|
+
UI.important("Could not find emulator port number, using default port.")
|
72
72
|
port = "5554"
|
73
73
|
end
|
74
74
|
|
75
|
-
Helper.log.info("Shutting down emulator...".green)
|
76
75
|
adb.trigger(command: "emu kill", serial: "emulator-#{port}")
|
77
76
|
|
78
|
-
|
77
|
+
UI.success("Deleting emulator...")
|
79
78
|
Action.sh("#{params[:sdk_path]}/tools/android delete avd -n #{params[:avd_name]}")
|
80
79
|
end
|
81
80
|
|
@@ -119,21 +118,27 @@ module Fastlane
|
|
119
118
|
is_string: true,
|
120
119
|
optional: true),
|
121
120
|
FastlaneCore::ConfigItem.new(key: :sdk_path,
|
122
|
-
env_name: "
|
121
|
+
env_name: "ANDROID_HOME",
|
123
122
|
description: "The path to your android sdk directory",
|
124
123
|
is_string: true,
|
125
|
-
default_value: ENV['
|
124
|
+
default_value: ENV['ANDROID_HOME'],
|
126
125
|
optional: true),
|
127
126
|
FastlaneCore::ConfigItem.new(key: :flags,
|
128
|
-
env_name: "
|
127
|
+
env_name: "FL_GRADLE_FLAGS",
|
129
128
|
description: "All parameter flags you want to pass to the gradle command, e.g. `--exitcode --xml file.xml`",
|
130
129
|
optional: true,
|
131
130
|
is_string: true),
|
132
131
|
FastlaneCore::ConfigItem.new(key: :task,
|
133
|
-
env_name: "
|
132
|
+
env_name: "FL_GRADLE_TASK",
|
134
133
|
description: "The gradle task you want to execute",
|
135
134
|
is_string: true,
|
136
|
-
optional:
|
135
|
+
optional: true,
|
136
|
+
default_value: "connectedCheck"),
|
137
|
+
FastlaneCore::ConfigItem.new(key: :project_dir,
|
138
|
+
env_name: 'FL_GRADLE_PROJECT_DIR',
|
139
|
+
description: 'The root directory of the gradle project. Defaults to `.`',
|
140
|
+
default_value: '.',
|
141
|
+
is_string: true)
|
137
142
|
]
|
138
143
|
end
|
139
144
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-instrumented_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Silviu Paragina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|