fastlane-plugin-aws_device_farm 0.3.16 → 0.3.17.pre.alpha.pre.128

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
  SHA256:
3
- metadata.gz: 8b223b834a25dd2c8a07a8f21dd10317926e4369d2c42da998b2392a32406d27
4
- data.tar.gz: 8dd9ce0c60864743a0682e7cc1d147929a098f2f15e1cc0feac6cdb2b9d4432d
3
+ metadata.gz: ffb110f0087afc2c52901e6552dc9b2d6248b042fb928f72f1efba883b15510b
4
+ data.tar.gz: 956a1771bc3f8282bb3dd34cf093c08396e62b6c86a7c0ceff272c16dd884290
5
5
  SHA512:
6
- metadata.gz: fa5cb8b1a2611f2091820575ea3ea6313d70da3325fe02c31f7632caff5c9ab957177b58db3a0a9ba09b380e2b0f9df5d113e0c566ec9914cf41af7670833a0d
7
- data.tar.gz: 1389378cf078ec87428aeda08ddd8867c79148ef1fa3867eaed58fffe8f22f0bc4532052ad57a2b6fb2ef0fdf0b50fb3cdcd364aa6fa61f5240c3bc52902c17e
6
+ metadata.gz: d7daa5498baed3f68c69f053e95dfdde0cfd8033b03fae2be76eb5671ea96dd356e7a53eb2a0e4f2d26e9ec468da3d98294e9db8373bf7366e5989dfb108316c
7
+ data.tar.gz: 530b4eadf4494ee3bdd7475cfdda8d56a593b04aa6d7a4ac2426518757bee9dcb45d78f5c7040a732626cb27b1d15ddcbecacd4e0ad39c5d72008e8fa58c9018
@@ -310,6 +310,36 @@ module Fastlane
310
310
  is_string: false,
311
311
  optional: true,
312
312
  default_value: false
313
+ ),
314
+ FastlaneCore::ConfigItem.new(
315
+ key: :artifact,
316
+ env_name: 'FL_ALLOW_ARTIFACT',
317
+ description: 'Do you download Artifact?',
318
+ is_string: false,
319
+ optional: true,
320
+ default_value: false
321
+ ),
322
+ FastlaneCore::ConfigItem.new(
323
+ key: :artifact_output_dir,
324
+ env_name: 'FL_ARTIFACT_OUTPUT_DIR',
325
+ description: 'Artifact output directory',
326
+ is_string: true,
327
+ optional: true,
328
+ default_value: "./test_outputs"
329
+ ),
330
+ FastlaneCore::ConfigItem.new(
331
+ key: :artifact_types,
332
+ env_name: 'FL_ARTIFACT_TYPES',
333
+ description: 'Download Artifact types',
334
+ is_string: false,
335
+ type: Array,
336
+ optional: true,
337
+ default_value: [],
338
+ verify_block: proc do |value|
339
+ valid_values = ['LOG',
340
+ 'SCREENSHOT']
341
+ raise "Artifact type concludes invalid values are: '#{(value - valid_values)}'. 🙈".red unless (value - valid_values).empty?
342
+ end
313
343
  )
314
344
  ]
315
345
  end
@@ -456,6 +486,30 @@ module Fastlane
456
486
  end
457
487
  rows << [status, j.name, j.device.form_factor, j.device.platform, j.device.os]
458
488
 
489
+ # artifact
490
+ artifact_support_types = %w(LOG SCREENSHOT)
491
+ params[:artifact_types].each do |type|
492
+ next unless artifact_support_types.include?(type) && params[:artifact]
493
+
494
+ artifact = @client.list_artifacts({
495
+ arn: j.arn,
496
+ type: type
497
+ })
498
+
499
+ artifact.artifacts.each do |artifact|
500
+ case type
501
+ when "LOG"
502
+ file_name = "#{artifact.name}.#{artifact.extension}"
503
+ when "SCREENSHOT"
504
+ file_name = "#{artifact.name}.#{artifact.extension}"
505
+ end
506
+
507
+ file_dir_path = "#{params[:artifact_output_dir]}/#{j.name}/#{j.device.os}"
508
+ Helper::AwsDeviceFarmHelper.get_artifact(url: artifact.url, file_dir_path: file_dir_path, file_name: file_name)
509
+ end
510
+ end
511
+
512
+ # test suites
459
513
  suite = @client.list_suites({
460
514
  arn: j.arn
461
515
  })
@@ -493,7 +547,10 @@ module Fastlane
493
547
  "time" => j.device_minutes.metered,
494
548
  "test_suites" => test_suites
495
549
  }
496
- Helper::AwsDeviceFarmHelper.create_junit_xml(test_results: test_results, file_path: params[:junit_xml_output_path]) if params[:junit_xml]
550
+
551
+ # need multi device support
552
+ file_prefix = "#{j.name}-#{j.device.os}"
553
+ Helper::AwsDeviceFarmHelper.create_junit_xml(test_results: test_results, file_path: params[:junit_xml_output_path], file_prefix: file_prefix) if params[:junit_xml]
497
554
  end
498
555
  end
499
556
 
@@ -1,12 +1,13 @@
1
1
  require 'rexml/document'
2
2
  require 'fileutils'
3
+ require 'open-uri'
3
4
 
4
5
  module Fastlane
5
6
  module Helper
6
7
  class AwsDeviceFarmHelper
7
8
 
8
9
  # create Junit.xml
9
- def self.create_junit_xml(test_results:, file_path:)
10
+ def self.create_junit_xml(test_results:, file_path:, file_prefix:)
10
11
  doc = REXML::Document.new
11
12
  doc << REXML::XMLDecl.new('1.0', 'UTF-8')
12
13
 
@@ -37,12 +38,26 @@ module Fastlane
37
38
  end
38
39
 
39
40
  # output
40
- FileUtils.mkdir_p(File.dirname(file_path))
41
- File.open(file_path, 'w') do |file|
41
+ file_name = "#{file_prefix}-#{File.basename(file_path)}"
42
+ file_dir_path = File.dirname(file_path)
43
+
44
+ FileUtils.mkdir_p(file_dir_path)
45
+ File.open("#{file_dir_path}/#{file_name}", 'w') do |file|
42
46
  doc.write(file, indent=2)
43
47
  end
44
48
  end
45
49
 
50
+ # get Artifact
51
+ def self.get_artifact(url:, file_dir_path:, file_name:)
52
+ file_path = "#{file_dir_path}/#{file_name}"
53
+ FileUtils.mkdir_p(File.dirname(file_path))
54
+
55
+ open(url) do |file|
56
+ open(file_path, "w+b") do |out|
57
+ out.write(file.read)
58
+ end
59
+ end
60
+ end
46
61
  end
47
62
  end
48
63
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AwsDeviceFarm
3
- VERSION = "0.3.16"
3
+ VERSION = "0.3.17"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-aws_device_farm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.16
4
+ version: 0.3.17.pre.alpha.pre.128
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-23 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -136,11 +136,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ">="
139
+ - - ">"
140
140
  - !ruby/object:Gem::Version
141
- version: '0'
141
+ version: 1.3.1
142
142
  requirements: []
143
- rubygems_version: 3.0.3
143
+ rubyforge_project:
144
+ rubygems_version: 2.7.7
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: Run UI Tests on AWS Devicefarm