fastlane-plugin-instrumented_tests 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 31b360d1f17a6faaee098e20bff2d1dbea23f8ae
4
- data.tar.gz: 0f516c84dfa5a5008259064533f70d1d9f07886e
3
+ metadata.gz: 85f9b58e24abc1295eca1af888789dc922c73d2d
4
+ data.tar.gz: 3fef50aa36cb239263fec444da4162652fb5d984
5
5
  SHA512:
6
- metadata.gz: d12292168548763b03e6e8a3f94f2e7a78af77e242eb5506c6a7e2d7d693eb6b4b5ab34c712ca9d374ff7b9b21c7f6d86c55e1c9d50982c00d2cad5edef649f2
7
- data.tar.gz: 4663d7c996f1bed6f73529036de6aa56dcc48ab7be5bc7a541dc39d5730e09933f76acd44ec0839be0764496228b7fd7bd8d6839af171039a4ee6d2236f5926f
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
- Helper.log.info("Creating AVD...".yellow)
28
+ UI.important("Creating AVD...")
30
29
  Action.sh(create_avd)
31
30
 
32
- Helper.log.info("Starting AVD....".yellow)
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
- gradle.trigger(task: params[:task], flags: params[:flags], serial: nil)
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
- Helper.log.info("Waiting for emulator to finish booting.....".yellow)
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
- stdout, _stdeerr, _status = Open3.capture3("#{params[:sdk_path]}/platform-tools/adb shell getprop sys.boot_completed")
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
- Helper.log.info("Emulator Booted!".green)
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
- Helper.log.info("Could not find emulator port number, using default port.".yellow)
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
- Helper.log.info("Deleting emulator....".green)
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: "SDK_PATH",
121
+ env_name: "ANDROID_HOME",
123
122
  description: "The path to your android sdk directory",
124
123
  is_string: true,
125
- default_value: ENV['SDK_PATH'],
124
+ default_value: ENV['ANDROID_HOME'],
126
125
  optional: true),
127
126
  FastlaneCore::ConfigItem.new(key: :flags,
128
- env_name: "GRADLE_FLAGS",
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: "GRADLE_TASK",
132
+ env_name: "FL_GRADLE_TASK",
134
133
  description: "The gradle task you want to execute",
135
134
  is_string: true,
136
- optional: false)
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
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module InstrumentedTests
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry