xamarin-test-cloud 0.9.30 → 0.9.31

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: 5acba22a909be04f6082a6889878d66ebe1b5cad
4
- data.tar.gz: 3feb44bf79cdb4c451684bafe7640b55f12abdc0
3
+ metadata.gz: e6cc7a61fe226ec7c9e26bd4f65529fcdba4ed12
4
+ data.tar.gz: 372e167b5ced6a7408aebe3762f40cc634f363c3
5
5
  SHA512:
6
- metadata.gz: 46fc122afaf9f2e734ad40b4268cde24907a3532db1c40dccf502d3e3ccf6400bdcc6de3c66c77de5c7e128e78db10c1d70ebe49913bf845830486ed5fb3057e
7
- data.tar.gz: 6e157b20859950aed4a801a909f787aff88ddb3e0295b642434f99d1f2f283d77930884f02a345ee7f01be76e34548dcbcc2a56a8a925225985b82676e19156c
6
+ metadata.gz: c9f2992ebfcf74ba9bbd075a7dec20b9a541e32d34dac1853e13f061465a7967d29bf353830d9560f82a06dc4cc10d351c81ff5a21e71a94cb51312aab22ab80
7
+ data.tar.gz: e6528050138788c57a8a2f3420b6678cefd568803d251aeb76369883a45252c19a01e3b7224823df8d5c0e83d10bf78651c72b8f883eb4324818f173213c0123
@@ -24,7 +24,8 @@ module XamarinTestCloud
24
24
  attr_accessor :host, :app, :api_key, :appname, :app_explorer, :test_parameters,
25
25
  :workspace, :config, :profile, :skip_config_check, :dry_run,
26
26
  :device_selection, :pretty, :async, :endpoint_path,
27
- :locale, :series
27
+ :locale, :series,
28
+ :dsym
28
29
 
29
30
  FILE_UPLOAD_ENDPOINT = 'upload2'
30
31
  FORM_URL_ENCODED_ENDPOINT = 'upload'
@@ -115,6 +116,13 @@ module XamarinTestCloud
115
116
  :desc => "Test series",
116
117
  :type => :string
117
118
 
119
+ method_option 'dsym-file',
120
+ :desc => 'Optional dSym file for iOS Crash symbolication',
121
+ :aliases => '-y',
122
+ :required => false,
123
+ :type => :string
124
+
125
+
118
126
 
119
127
  def submit(app, api_key)
120
128
 
@@ -166,6 +174,14 @@ module XamarinTestCloud
166
174
 
167
175
  self.skip_config_check = options['skip-config-check']
168
176
 
177
+ self.dsym= options['dsym-file']
178
+ if dsym
179
+ dsym_extension = File.extname(self.dsym)
180
+ unless /dsym/i.match(dsym_extension) && File.directory?(dsym)
181
+ raise ValidationError, "dsym-file must be a directory and have dSYM extension: #{dsym}"
182
+ end
183
+ end
184
+
169
185
 
170
186
  workspace_path = options[:workspace] || File.expand_path('.')
171
187
 
@@ -225,6 +241,7 @@ module XamarinTestCloud
225
241
  puts "Workspace = #{self.workspace}"
226
242
  puts "Config = #{self.config}"
227
243
  puts "Profile = #{self.profile}"
244
+ puts "dSym = #{self.dsym}"
228
245
  end
229
246
 
230
247
 
@@ -380,8 +397,7 @@ module XamarinTestCloud
380
397
  return
381
398
  end
382
399
 
383
- app_file, files, paths = gather_files_and_paths_to_upload(all_files(tmpdir), tmpdir)
384
-
400
+ app_file, dsym_zip, files, paths = gather_files_and_paths_to_upload(all_files(tmpdir), tmpdir)
385
401
 
386
402
  log_header('Uploading negotiated files')
387
403
 
@@ -396,6 +412,8 @@ module XamarinTestCloud
396
412
  'locale' => self.locale,
397
413
  'series' => self.series,
398
414
  'api_key' => api_key,
415
+ 'dsym_file' => dsym_zip,
416
+ 'dsym_filename' => dsym_zipped_name,
399
417
  'app_filename' => File.basename(app)}
400
418
 
401
419
  if profile #only if config and profile
@@ -513,7 +531,16 @@ module XamarinTestCloud
513
531
 
514
532
  log_header('Negotiating upload')
515
533
 
516
- response = http_post('check_hash', {'hashes' => hashes, 'app_hash' => digest(app)})
534
+ app_digest = digest(app)
535
+ dsym_digest= nil
536
+ if dsym
537
+ dsym_abs_path= File.join(tmpdir,dsym_zipped_name)
538
+ dsym_digest = digest(dsym_abs_path)
539
+ end
540
+ out = {'hashes' => hashes, 'app_hash' => app_digest, 'dsym_hash' => dsym_digest}
541
+
542
+ response = http_post('check_hash', out)
543
+
517
544
 
518
545
  cache_status = JSON.parse(response)
519
546
 
@@ -543,9 +570,13 @@ module XamarinTestCloud
543
570
  paths << 'config/cucumber.yml'
544
571
  end
545
572
 
546
- app_file = cache_status[digest(app)] ? digest(app) : File.new(app)
573
+ app_file = cache_status[app_digest] ? app_digest : File.new(app)
574
+
575
+ if dsym_digest
576
+ dsym_file = cache_status[dsym_digest] ? dsym_digest : File.new(dsym_abs_path)
577
+ end
547
578
 
548
- return app_file, files, paths
579
+ return app_file, dsym_file, files, paths
549
580
  end
550
581
 
551
582
  def digest(file)
@@ -626,6 +657,15 @@ module XamarinTestCloud
626
657
  files << config
627
658
  end
628
659
 
660
+ if dsym
661
+ FileUtils.cp_r(dsym,tmpdir)
662
+ dsym_files = Dir.glob(File.join(tmpdir, File.basename(dsym), '**','*'))
663
+
664
+ outfile = File.join(tmpdir,dsym_zipped_name)
665
+ zip_dsym_files(dsym_files,tmpdir, outfile)
666
+
667
+ end
668
+
629
669
 
630
670
  files += Dir.glob(File.join(tmpdir,"vendor", 'cache', '*'))
631
671
 
@@ -643,6 +683,12 @@ module XamarinTestCloud
643
683
  {:feature_prefix => dir, :workspace_prefix => workspace, :files => files.find_all { |file_or_dir| File.file? file_or_dir }}
644
684
  end
645
685
 
686
+ def dsym_zipped_name
687
+ if dsym
688
+ "#{File.basename(self.app)}_dSym.zip"
689
+ end
690
+ end
691
+
646
692
  def http_post(address, args, &block)
647
693
  exec_options = {}
648
694
  if ENV['XTC_USERNAME'] && ENV['XTC_PASSWORD']
@@ -773,6 +819,15 @@ module XamarinTestCloud
773
819
  end
774
820
  end
775
821
 
822
+ def zip_dsym_files(files,basedir, out)
823
+ Zip::ZipFile.open(out, Zip::ZipFile::CREATE) do |zipfile|
824
+ files.each do |file|
825
+ zipfile.add(file.sub("#{basedir}#{File::Separator}",''), file)
826
+ end
827
+ end
828
+
829
+ end
830
+
776
831
 
777
832
 
778
833
  def verify_dependencies(path)
@@ -1,3 +1,3 @@
1
1
  module XamarinTestCloud
2
- VERSION = '0.9.30'
2
+ VERSION = '0.9.31'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xamarin-test-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.30
4
+ version: 0.9.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-19 00:00:00.000000000 Z
12
+ date: 2014-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor