knapsack_pro 7.6.0 → 7.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +12 -0
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/knapsack_pro.gemspec +1 -1
- data/lib/knapsack_pro/formatters/time_tracker.rb +2 -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: 1fd5c8d52aa9de26d125b40b1c3b60ee7536a75e9351b524ad9d99386fd6bfc8
|
4
|
+
data.tar.gz: 491d49252b139b817939ef4555a36fba6ca6ca74cc70e9a325124e0a900bb5ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1b030ead892b4251f9e191049425675105940777e5061a81e23b90ce8481e3a0564832068202d56d912afe62e5e92482a771f06e7c3faeaf331dc5d772a583c
|
7
|
+
data.tar.gz: 82f5ba33b17213da4b7a7b8e2647042559b52ac12c0aae7255f838ed4e6ed70d0fab80d7009434855e58c1c63d3c11fb9cfe69f85fab5968fa37edc3005d1250
|
data/.circleci/config.yml
CHANGED
@@ -165,6 +165,18 @@ jobs:
|
|
165
165
|
export KNAPSACK_PRO_ENDPOINT=https://api-fake.knapsackpro.com
|
166
166
|
export KNAPSACK_PRO_MAX_REQUEST_RETRIES=1
|
167
167
|
bundle exec rake knapsack_pro:rspec
|
168
|
+
- run:
|
169
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
170
|
+
command: |
|
171
|
+
# ensures KnapsackPro::Formatters::TimeTracker works when the .rspec file does not exist
|
172
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular--no-dot-rspec-file"
|
173
|
+
mv .rspec .rspec.off
|
174
|
+
# load test files that require spec_helper explicitly
|
175
|
+
export KNAPSACK_PRO_TEST_FILE_PATTERN="{spec/time_tracker_spec.rb}"
|
176
|
+
bundle exec rake knapsack_pro:rspec
|
177
|
+
RSPEC_EXIT_CODE=$?
|
178
|
+
mv .rspec.off .rspec
|
179
|
+
exit $RSPEC_EXIT_CODE
|
168
180
|
- run:
|
169
181
|
working_directory: ~/rails-app-with-knapsack_pro
|
170
182
|
command: |
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,22 @@
|
|
2
2
|
|
3
3
|
### UNRELEASED
|
4
4
|
|
5
|
+
### 7.6.2
|
6
|
+
|
7
|
+
* Fix an error for the `KnapsackPro::Formatters::TimeTracker` formatter in RSpec when using Knapsack Pro Regular Mode and the `.rspec` file is not present.
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/265
|
10
|
+
|
11
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.6.1...v7.6.2
|
12
|
+
|
13
|
+
### 7.6.1
|
14
|
+
|
15
|
+
* 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.
|
16
|
+
|
17
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/262
|
18
|
+
|
19
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.6.0...v7.6.1
|
20
|
+
|
5
21
|
### 7.6.0
|
6
22
|
|
7
23
|
* Avoid starting an unnecessary process in Queue Mode.
|
data/README.md
CHANGED
@@ -78,7 +78,7 @@ Scripted tests can be found in the [Rails App With Knapsack Pro repository](http
|
|
78
78
|
|
79
79
|
2. Update the gem version in `lib/knapsack_pro/version.rb`
|
80
80
|
|
81
|
-
3. `git commit -am "
|
81
|
+
3. `git commit -am "Bump version x.x.x"`
|
82
82
|
|
83
83
|
4. Build, tag, push, release: `bundle exec rake release`
|
84
84
|
|
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
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'stringio'
|
4
|
+
require_relative '../utils'
|
4
5
|
|
5
6
|
module KnapsackPro
|
6
7
|
module Formatters
|
@@ -145,7 +146,7 @@ module KnapsackPro
|
|
145
146
|
end
|
146
147
|
|
147
148
|
def now
|
148
|
-
|
149
|
+
KnapsackPro::Utils.time_now
|
149
150
|
end
|
150
151
|
end
|
151
152
|
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.2
|
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-27 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
|