trainer 0.1.1 → 0.1.3

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: 2d3f3f7766506007d3f80b42de82fe1c92582ffe
4
- data.tar.gz: c04661b81b99b5fe24e056609fce852280f63935
3
+ metadata.gz: ea5f5a25b2bf4b4dc97a8eb2852329b2e6f162ac
4
+ data.tar.gz: 145951b040f3ba7f303bed5daabf90f76ae21d68
5
5
  SHA512:
6
- metadata.gz: 2fa78e21f1ff0585fd779781f5d3ffc76998637c326be9beb496f10311a5a8c7a35d51703db2efe57a4a0c13a9a9c3c0df5856662c1fb7c3730b6d1a227ad96a
7
- data.tar.gz: c8765f4ebbe0de90fc45a07b484e6d45b39a82414aa9a60f49242f57f86dcec4667090d1ddc37bedd77f8c4faeb747ca0e709b3941bdadf2a5087a74bc716bc6
6
+ metadata.gz: 7c648fe59e528643f422ba0a87340608a2b1a6c2b97b2b514a2df2036d447384a396ee70f8e98f3bdfb3eb3b923377e22e835b4ec6b6c339a4548d9cf6cecd65
7
+ data.tar.gz: 3ec4dc20b8a9f0274b3a8a1c064b0dddb7477031593e021f394ab5eac29760db9aeb53d3dd007d5a70ffc079df354c6d06a9f215a914ffab304adf8f731ccfc5
data/README.md CHANGED
@@ -18,11 +18,15 @@ Now add the following to your `Fastfile`
18
18
 
19
19
  ```ruby
20
20
  lane :test do
21
- scan(workspace: "MyApp.xcworkspace")
21
+ scan(workspace: "MyApp.xcworkspace",
22
+ output_types: "",
23
+ derived_data_path: "/tmp/fastlane_trainer/#{Time.now.to_i}")
22
24
  trainer
23
25
  end
24
26
  ```
25
27
 
28
+ This will generate the JUnit file in the temporary location `/tmp/fastlane_trainer/[time]`. You can specify any path you want, just make sure to have it clean for every run so that your CI system knows which one to pick.
29
+
26
30
  For more information, check out the [fastlane plugin docs](fastlane-plugin-trainer#readme).
27
31
 
28
32
  ## Without [fastlane](https://fastlane.tools)
@@ -69,6 +73,12 @@ For more information run
69
73
  trainer --help
70
74
  ````
71
75
 
76
+ ### Show the test results right in your pull request
77
+
78
+ To make it easier for you and your contributors to see the test failures, you should start using [danger](http://danger.systems) with the [danger-junit](https://github.com/orta/danger-junit) plugin
79
+
80
+ ![](https://raw.githubusercontent.com/orta/danger-junit/master/img/example.png)
81
+
72
82
  ### Thanks
73
83
 
74
84
  After the [lobbying of @steipete](https://twitter.com/steipete/status/753662170848690176) and the comment
@@ -31,7 +31,7 @@ module Trainer
31
31
  c.action do |args, options|
32
32
  options = FastlaneCore::Configuration.create(Trainer::Options.available_options, options.__hash__)
33
33
  FastlaneCore::PrintTable.print_values(config: options, title: "Summary for trainer #{Trainer::VERSION}") if $verbose
34
- Trainer::TestParser.auto_convert(options[:path])
34
+ Trainer::TestParser.auto_convert(options)
35
35
  end
36
36
  end
37
37
 
@@ -4,13 +4,27 @@ module Trainer
4
4
  @options ||= [
5
5
  FastlaneCore::ConfigItem.new(key: :path,
6
6
  short_option: "-p",
7
- env_name: "trainer_PATH",
7
+ env_name: "TRAINER_PATH",
8
8
  default_value: ".",
9
9
  description: "Path to the directory that should be converted",
10
10
  verify_block: proc do |value|
11
11
  v = File.expand_path(value.to_s)
12
12
  UI.user_error!("Path '#{v}' is not a directory or can't be found") unless File.directory?(v)
13
- end)
13
+ end),
14
+ FastlaneCore::ConfigItem.new(key: :extension,
15
+ short_option: "-e",
16
+ env_name: "TRAINER_EXTENSION",
17
+ default_value: ".xml",
18
+ description: "The extension for the newly created file. Usually .xml or .junit",
19
+ verify_block: proc do |value|
20
+ UI.user_error!("extension must contain a `.`") unless value.include?(".")
21
+ end),
22
+ FastlaneCore::ConfigItem.new(key: :output_directory,
23
+ short_option: "-o",
24
+ env_name: "TRAINER_OUTPUT_DIRECTORY",
25
+ default_value: nil,
26
+ optional: true,
27
+ description: "Directoy in which the xml files should be written to. Same directory as source by default"),
14
28
  ]
15
29
  end
16
30
  end
@@ -6,7 +6,8 @@ module Trainer
6
6
 
7
7
  attr_accessor :raw_json
8
8
 
9
- def self.auto_convert(containing_dir)
9
+ def self.auto_convert(config)
10
+ containing_dir = config[:path]
10
11
  files = Dir["#{containing_dir}/**/Logs/Test/*TestSummaries.plist"]
11
12
  files += Dir["#{containing_dir}/Test/*TestSummaries.plist"]
12
13
  files += Dir["#{containing_dir}/*TestSummaries.plist"]
@@ -14,7 +15,14 @@ module Trainer
14
15
  UI.user_error!("No test result files found in directory '#{containing_dir}'") if files.empty?
15
16
 
16
17
  return files.collect do |path|
17
- to_path = path.gsub(".plist", ".junit")
18
+ if config[:output_directory]
19
+ FileUtils.mkdir_p(config[:output_directory])
20
+ filename = File.basename(path).gsub(".plist", config[:extension])
21
+ to_path = File.join(config[:output_directory], filename)
22
+ else
23
+ to_path = path.gsub(".plist", config[:extension])
24
+ end
25
+
18
26
  File.write(to_path, Trainer::TestParser.new(path).to_junit)
19
27
  puts "Successfully generated '#{to_path}'"
20
28
  to_path
@@ -1,4 +1,4 @@
1
1
  module Trainer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  DESCRIPTION = "Convert xcodebuild plist files to JUnit reports"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trainer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-01 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -158,8 +158,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.6
161
+ rubygems_version: 2.6.6
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Convert xcodebuild plist files to JUnit reports
165
165
  test_files: []
166
+ has_rdoc: