fastlane-plugin-aws_device_farm 0.3.16 → 0.3.20

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: e91653f74dbcf72292f3e642baee0a139ab7b9a2eacbc48c943ad23e791dc3c2
4
+ data.tar.gz: 98c2cd4e0829037c141d1b9a2d59cf5eb2e6d5cddfc939b0c9f69585c0b110f0
5
5
  SHA512:
6
- metadata.gz: fa5cb8b1a2611f2091820575ea3ea6313d70da3325fe02c31f7632caff5c9ab957177b58db3a0a9ba09b380e2b0f9df5d113e0c566ec9914cf41af7670833a0d
7
- data.tar.gz: 1389378cf078ec87428aeda08ddd8867c79148ef1fa3867eaed58fffe8f22f0bc4532052ad57a2b6fb2ef0fdf0b50fb3cdcd364aa6fa61f5240c3bc52902c17e
6
+ metadata.gz: c9abddf60d30aa09fc36e67ae12a1050beaf8e65cf4eed1ceaa35e08fd0e306c47242264f902f23976817994dda3ca89ead18304f116bf08b1eb2e95d1a14e1d
7
+ data.tar.gz: 5bf881fc4e026fa5f2337fcaf4865a5a198a1142a9d1b5b2d725116ff864873f1eca2f2feb88dd1ca5b914a32b8e8cfac82dd88e43ee4b7f125145530b57066a
@@ -18,7 +18,6 @@ module Fastlane
18
18
  # Fetch the device pool.
19
19
  device_pool = fetch_device_pool project, params[:device_pool]
20
20
  raise "Device pool '#{params[:device_pool]}' not found. 🙈" if device_pool.nil?
21
-
22
21
  # Create the upload.
23
22
  path = File.expand_path(params[:binary_path])
24
23
  type = File.extname(path) == '.apk' ? 'ANDROID_APP' : 'IOS_APP'
@@ -86,6 +85,12 @@ module Fastlane
86
85
 
87
86
  run
88
87
  end
88
+
89
+ # Get the network profile from params if value is provided
90
+ if params[:network_profile_arn]
91
+ configuration[:network_profile_arn] = params[:network_profile_arn]
92
+ end
93
+
89
94
  # rubocop:enable Metrics/BlockNesting
90
95
  #
91
96
  #####################################################
@@ -224,6 +229,14 @@ module Fastlane
224
229
  is_string: true,
225
230
  optional: false
226
231
  ),
232
+ FastlaneCore::ConfigItem.new(
233
+ key: :network_profile_arn,
234
+ env_name: 'FL_AWS_DEVICE_FARM_NETWORK_PROFILE_ARN',
235
+ description: 'Network profile arn you want to use for running the applications',
236
+ default_value: nil,
237
+ optional: false,
238
+ is_string: true
239
+ ),
227
240
  FastlaneCore::ConfigItem.new(
228
241
  key: :wait_for_completion,
229
242
  env_name: 'FL_AWS_DEVICE_FARM_WAIT_FOR_COMPLETION',
@@ -310,6 +323,36 @@ module Fastlane
310
323
  is_string: false,
311
324
  optional: true,
312
325
  default_value: false
326
+ ),
327
+ FastlaneCore::ConfigItem.new(
328
+ key: :artifact,
329
+ env_name: 'FL_ALLOW_ARTIFACT',
330
+ description: 'Do you download Artifact?',
331
+ is_string: false,
332
+ optional: true,
333
+ default_value: false
334
+ ),
335
+ FastlaneCore::ConfigItem.new(
336
+ key: :artifact_output_dir,
337
+ env_name: 'FL_ARTIFACT_OUTPUT_DIR',
338
+ description: 'Artifact output directory',
339
+ is_string: true,
340
+ optional: true,
341
+ default_value: "./test_outputs"
342
+ ),
343
+ FastlaneCore::ConfigItem.new(
344
+ key: :artifact_types,
345
+ env_name: 'FL_ARTIFACT_TYPES',
346
+ description: 'Download Artifact types',
347
+ is_string: false,
348
+ type: Array,
349
+ optional: true,
350
+ default_value: [],
351
+ verify_block: proc do |value|
352
+ valid_values = ['LOG',
353
+ 'SCREENSHOT']
354
+ raise "Artifact type concludes invalid values are: '#{(value - valid_values)}'. 🙈".red unless (value - valid_values).empty?
355
+ end
313
356
  )
314
357
  ]
315
358
  end
@@ -375,7 +418,6 @@ module Fastlane
375
418
  })
376
419
  device_pools.device_pools.detect { |p| p.name == device_pool }
377
420
  end
378
-
379
421
  def self.schedule_run(name, project, device_pool, upload, test_upload, type, params)
380
422
  # Prepare the test hash depening if you passed the test apk.
381
423
  test_hash = { type: 'BUILTIN_FUZZ' }
@@ -401,7 +443,8 @@ module Fastlane
401
443
 
402
444
  configuration_hash = {
403
445
  billing_method: params[:billing_method],
404
- locale: params[:locale]
446
+ locale: params[:locale],
447
+ network_profile_arn: params[:network_profile_arn]
405
448
  }
406
449
 
407
450
  @client.schedule_run({
@@ -456,6 +499,30 @@ module Fastlane
456
499
  end
457
500
  rows << [status, j.name, j.device.form_factor, j.device.platform, j.device.os]
458
501
 
502
+ # artifact
503
+ artifact_support_types = %w(LOG SCREENSHOT)
504
+ params[:artifact_types].each do |type|
505
+ next unless artifact_support_types.include?(type) && params[:artifact]
506
+
507
+ artifact = @client.list_artifacts({
508
+ arn: j.arn,
509
+ type: type
510
+ })
511
+
512
+ artifact.artifacts.each do |artifact|
513
+ case type
514
+ when "LOG"
515
+ file_name = "#{artifact.name}.#{artifact.extension}"
516
+ when "SCREENSHOT"
517
+ file_name = "#{artifact.name}.#{artifact.extension}"
518
+ end
519
+
520
+ file_dir_path = "#{params[:artifact_output_dir]}/#{j.name}/#{j.device.os}"
521
+ Helper::AwsDeviceFarmHelper.get_artifact(url: artifact.url, file_dir_path: file_dir_path, file_name: file_name)
522
+ end
523
+ end
524
+
525
+ # test suites
459
526
  suite = @client.list_suites({
460
527
  arn: j.arn
461
528
  })
@@ -493,7 +560,10 @@ module Fastlane
493
560
  "time" => j.device_minutes.metered,
494
561
  "test_suites" => test_suites
495
562
  }
496
- Helper::AwsDeviceFarmHelper.create_junit_xml(test_results: test_results, file_path: params[:junit_xml_output_path]) if params[:junit_xml]
563
+
564
+ # need multi device support
565
+ file_prefix = "#{j.name}-#{j.device.os}"
566
+ 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
567
  end
498
568
  end
499
569
 
@@ -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.20"
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.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-23 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description:
111
+ description:
112
112
  email: helmut@januschka.com
113
113
  executables: []
114
114
  extensions: []
@@ -125,7 +125,7 @@ homepage: https://github.com/hjanuschka/fastlane-plugin-aws_device_farm
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -140,8 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.0.3
144
- signing_key:
143
+ rubygems_version: 3.0.8
144
+ signing_key:
145
145
  specification_version: 4
146
146
  summary: Run UI Tests on AWS Devicefarm
147
147
  test_files: []