xcknife 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79b1c563a88dfb2d6fb4cf6cefd1c845c320b555804c58c72e8ccbb7525f4f2a
4
- data.tar.gz: dd72d8692ff7d834c54b24f4c028ee1b85e8f63978a8b44a0cc315462f21c259
3
+ metadata.gz: 365fe40eceedeaed44f3287b13d9e8187fed76bcb50889234048434a5780aa11
4
+ data.tar.gz: 9b9bb9181a6547d4a288835e866a617a01ff4c3472eb9ba1ee4520ecb3e1804a
5
5
  SHA512:
6
- metadata.gz: 7e2d19bd7130d60a1301a125cb7ba88fedb61910732ec7adf63be818872349976801f61747416c3d7a2323bbbe15cffef4207756718ae7bb3ba57687bb76eeb4
7
- data.tar.gz: 1b2909467c40f7277bcebd48cde21b321a9432cdc868a928425a06a25dec01f638d7d2bd64f3d5741aac47aa4e4b680681b1a2be3cebb2cef364e93376b007e3
6
+ metadata.gz: e2657f17daeea0ebb7f84556f7531f8465fdca6ac5c60431ee34bfa816158e4e96bc2db7886091bf3c7959651950c23082835543271601ca9a61acb069d1349d
7
+ data.tar.gz: 342e20d4bef7ffef984dc97180de79beb85f5addadd316472dcb2cc7400d96a8eca0f6526525671fc9b6d853d4330df50d753fff290dcd1c2cb582152c88c42d
@@ -0,0 +1,24 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ integration_tests:
11
+ name: Build and Test
12
+ runs-on: macos-latest
13
+ steps:
14
+ - uses: actions/checkout@v1
15
+ - name: Select Xcode 11.6
16
+ run: sudo xcode-select -s /Applications/Xcode_11.6.app
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: "2.6" # Version range or exact version of a Ruby version to use, using semvers version range syntax.
20
+ bundler-cache: true
21
+ - name: Installing GNU coreutils
22
+ run: brew install coreutils
23
+ - name: Build and Test
24
+ run: bundle exec rake build_test_dumper spec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcknife (0.12.0)
4
+ xcknife (0.13.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
+ require 'bundler/gem_tasks'
4
5
 
5
6
  require 'rspec/core/rake_task'
6
7
  RSpec::Core::RakeTask.new(:spec)
data/lib/xcknife.rb CHANGED
@@ -9,5 +9,5 @@ require 'xcknife/exceptions'
9
9
  require 'xcknife/xcscheme_analyzer'
10
10
 
11
11
  module XCKnife
12
- VERSION = '0.12.0'
12
+ VERSION = '0.13.0'
13
13
  end
@@ -12,13 +12,14 @@ module XCKnife
12
12
 
13
13
  attr_reader :number_of_shards, :test_partitions, :stats, :relevant_partitions
14
14
 
15
- def initialize(number_of_shards, test_partitions, options_for_metapartition: Array.new(test_partitions.size, {}), allow_fewer_shards: false)
15
+ def initialize(number_of_shards, test_partitions, options_for_metapartition: Array.new(test_partitions.size, {}), allow_fewer_shards: false, on_extrapolation: nil)
16
16
  @number_of_shards = number_of_shards
17
17
  @test_partitions = test_partitions.map(&:to_set)
18
18
  @relevant_partitions = test_partitions.flatten.to_set
19
19
  @stats = ResultStats.new
20
20
  @options_for_metapartition = options_for_metapartition.map { |o| Options::DEFAULT.merge(o) }
21
21
  @allow_fewer_shards = allow_fewer_shards
22
+ @on_extrapolation = on_extrapolation
22
23
  ResultStats.members.each { |k| @stats[k] = 0 }
23
24
  end
24
25
 
@@ -224,15 +225,18 @@ module XCKnife
224
225
  analyzer.target_class_map.each do |test_target, class_set|
225
226
  if times_for_target_class.key?(test_target)
226
227
  class_set.each do |clazz|
227
- unless times_for_target_class[test_target].key?(clazz)
228
- inc_stat :class_extrapolations
229
- times_for_target_class[test_target][clazz] = median_map[test_target]
230
- end
228
+ next if times_for_target_class[test_target].key?(clazz)
229
+
230
+ inc_stat :class_extrapolations
231
+ @on_extrapolation&.call(test_target: test_target, test_class: clazz)
232
+ times_for_target_class[test_target][clazz] = median_map[test_target]
231
233
  end
232
234
  else
233
235
  inc_stat :target_extrapolations
236
+ @on_extrapolation&.call(test_target: test_target, test_class: nil)
234
237
  class_set.each do |clazz|
235
238
  inc_stat :class_extrapolations
239
+ @on_extrapolation&.call(test_target: test_target, test_class: clazz)
236
240
  times_for_target_class[test_target][clazz] = extrapolated_duration(median_of_targets, class_set)
237
241
  end
238
242
  end
@@ -454,8 +454,8 @@ module XCKnife
454
454
  | # or swift instance method
455
455
  _? # only present on Xcode 10.0 and below
456
456
  (?:@objc\s)? # optional objc annotation
457
- (?:[^.]+\.)? # module name
458
- (.+) # class name
457
+ (?:[^. ]+\.)? # module name
458
+ ([^ ]+) # class name
459
459
  \.(test.+)\s->\s\(\) # method signature
460
460
  )
461
461
  $/ox
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcknife
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -37,11 +37,11 @@ executables:
37
37
  extensions: []
38
38
  extra_rdoc_files: []
39
39
  files:
40
+ - ".github/workflows/tests.yml"
40
41
  - ".gitignore"
41
42
  - ".rspec"
42
43
  - ".rubocop.yml"
43
44
  - ".ruby-version"
44
- - ".travis.yml"
45
45
  - ".vscode/configure.sh"
46
46
  - ".vscode/vscode_ruby.json.template"
47
47
  - CONTRIBUTING.md
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.0.8
99
+ rubygems_version: 3.0.1
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Simple tool for optimizing XCTest runs across machines
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: objective-c
2
- sudo: false
3
- matrix:
4
- include:
5
- - os: osx
6
- osx_image: xcode11.6
7
-
8
- before_script:
9
- - export LANG=en_US.UTF-8
10
- install: bundle
11
- script:
12
- - csrutil status
13
- - git submodule update --init --recursive
14
- - bundle exec rake build_test_dumper spec