fastlane-plugin-aws_device_farm 0.3.16.pre.alpha.pre.126 → 0.3.16.pre.alpha.pre.127

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: 3592492dc92fa15371839ee16fcf46571f98bb6c414bfbb6502df51c19acfa3a
4
- data.tar.gz: c0439e45075f4306f284de74c4cbe00c8575fe9ee94394d338b36e7dc26d6181
3
+ metadata.gz: 765ed5368246588d4d35b7e44a33beb8b9e108b5e6716bb2420194047f7fb669
4
+ data.tar.gz: a76dc14d0bdd81443ec5ced5d5d3603e26b96fa01f96420217a1fc42aafc646f
5
5
  SHA512:
6
- metadata.gz: 9de7694004d8d0097a5af6e26088d0699daf0fe6ca0f939ce4c5b23a3a6044585dd174a328a42fc0fbd0966d02adeb34e09a997fa3ea92a6381c0173e8cd5952
7
- data.tar.gz: ae83104a17eaf3aa51980a3c6debbaabd9ae21e55b2757a0e43c90c48ac18bdc2dc6ec855fc53b0b602f84ad060c66d7a81c7e77e7e06086c763ffd2024f1538
6
+ metadata.gz: 174c10d478339187850d9afabbbdee72d1d4999ba6ea437a7e4ce9c32831d6f576a7724c0ce9561497d8f41871d99254292d8100db1a6a42e80b9de64064f103
7
+ data.tar.gz: 47f7f1d40399643d864ce24e983c0ed8ca83707690c0d6b3b3837345d9ee51acd62a64ef0db27ab99bbe854a479c753cc7e15b6dd778c19506ca8f5188365236
@@ -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
  })
@@ -1,5 +1,6 @@
1
1
  require 'rexml/document'
2
2
  require 'fileutils'
3
+ require 'open-uri'
3
4
 
4
5
  module Fastlane
5
6
  module Helper
@@ -46,6 +47,17 @@ module Fastlane
46
47
  end
47
48
  end
48
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
49
61
  end
50
62
  end
51
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.pre.alpha.pre.126
4
+ version: 0.3.16.pre.alpha.pre.127
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka