knapsack_pro 7.6.0 → 7.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/knapsack_pro.gemspec +1 -1
- data/lib/knapsack_pro/formatters/time_tracker.rb +1 -1
- data/lib/knapsack_pro/tracker.rb +1 -1
- data/lib/knapsack_pro/utils.rb +8 -0
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/utils_spec.rb +36 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11356d7eace33ba43c1dec527436091c103ac8b5d6c9bd2ae28851294854d4df
|
4
|
+
data.tar.gz: 15717cbb12d7d9143be84504464ecd32a25841bb984e70ec88ec6b3c05b0dcbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a12e300c1a6a7427836b2a62d71b7ccb35174c31d444ac77fdd19847a7b9b85fc805adb9bd966329d0c7e21e58c233230e63e8943b14bad6b9267236c69ee3a
|
7
|
+
data.tar.gz: 3ac187d311a35d343c5c6fd86c667049642638862d5dff4d68ecff91d63191b05a1206881d24efebd3163d92cbd69e08bd8d0a4b129f69bf45b348dde49662be
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
### UNRELEASED
|
4
4
|
|
5
|
+
### 7.6.1
|
6
|
+
|
7
|
+
* Add support for the Timecop 0.9.9 gem version so that we could track proper tests' execution time when `Process.clock_gettime` is mocked.
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/262
|
10
|
+
|
11
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.6.0...v7.6.1
|
12
|
+
|
5
13
|
### 7.6.0
|
6
14
|
|
7
15
|
* Avoid starting an unnecessary process in Queue Mode.
|
data/knapsack_pro.gemspec
CHANGED
@@ -38,5 +38,5 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_development_dependency 'pry', '~> 0'
|
39
39
|
spec.add_development_dependency 'vcr', '>= 6.0'
|
40
40
|
spec.add_development_dependency 'webmock', '>= 3.13'
|
41
|
-
spec.add_development_dependency 'timecop', '>= 0.9.
|
41
|
+
spec.add_development_dependency 'timecop', '>= 0.9.9'
|
42
42
|
end
|
data/lib/knapsack_pro/tracker.rb
CHANGED
data/lib/knapsack_pro/utils.rb
CHANGED
@@ -5,5 +5,13 @@ module KnapsackPro
|
|
5
5
|
def self.unsymbolize(obj)
|
6
6
|
JSON.parse(obj.to_json)
|
7
7
|
end
|
8
|
+
|
9
|
+
def self.time_now
|
10
|
+
if defined?(Timecop) && Process.respond_to?(:clock_gettime_without_mock)
|
11
|
+
Process.clock_gettime_without_mock(Process::CLOCK_MONOTONIC)
|
12
|
+
else
|
13
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
14
|
+
end
|
15
|
+
end
|
8
16
|
end
|
9
17
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -16,4 +16,40 @@ describe KnapsackPro::Utils do
|
|
16
16
|
])
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
describe '.time_now' do
|
21
|
+
subject { described_class.time_now }
|
22
|
+
|
23
|
+
context 'when Timecop does not mock the time' do
|
24
|
+
it do
|
25
|
+
now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
26
|
+
expect(subject).to be_within(0.001).of(now)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'when Timecop does mock the process clock' do
|
31
|
+
around(:example) do |ex|
|
32
|
+
unless Gem::Version.new(Timecop::VERSION) >= Gem::Version.new('0.9.9')
|
33
|
+
raise 'Timecop >= 0.9.9 is required to run this test. Please run: bundle update'
|
34
|
+
end
|
35
|
+
|
36
|
+
if Gem::Version.new(Timecop::VERSION) >= Gem::Version.new('0.9.10')
|
37
|
+
Timecop.mock_process_clock = true
|
38
|
+
ex.run
|
39
|
+
Timecop.mock_process_clock = false
|
40
|
+
else
|
41
|
+
ex.run
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it do
|
46
|
+
now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
47
|
+
|
48
|
+
time = Time.local(2020, 1, 31)
|
49
|
+
Timecop.travel(time) do
|
50
|
+
expect(subject).to be_within(0.001).of(now)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
19
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.6.
|
4
|
+
version: 7.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.9.
|
173
|
+
version: 0.9.9
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.9.
|
180
|
+
version: 0.9.9
|
181
181
|
description: Knapsack Pro wraps your current test runner(s) and works with your existing
|
182
182
|
CI infrastructure to parallelize tests optimally. It dynamically splits your tests
|
183
183
|
based on up-to-date test execution data. It's designed from the ground up for CI
|