knapsack_pro 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -3
- data/CHANGELOG.md +4 -0
- data/README.md +368 -4
- data/bin/knapsack_pro +20 -0
- data/circle.yml +2 -0
- data/knapsack_pro.gemspec +6 -1
- data/lib/knapsack_pro.rb +74 -0
- data/lib/knapsack_pro/adapters/base_adapter.rb +30 -0
- data/lib/knapsack_pro/adapters/cucumber_adapter.rb +40 -0
- data/lib/knapsack_pro/adapters/minitest_adapter.rb +52 -0
- data/lib/knapsack_pro/adapters/rspec_adapter.rb +48 -0
- data/lib/knapsack_pro/allocator.rb +40 -0
- data/lib/knapsack_pro/allocator_builder.rb +40 -0
- data/lib/knapsack_pro/client/api/action.rb +17 -0
- data/lib/knapsack_pro/client/api/v1/base.rb +15 -0
- data/lib/knapsack_pro/client/api/v1/build_distributions.rb +29 -0
- data/lib/knapsack_pro/client/api/v1/build_subsets.rb +29 -0
- data/lib/knapsack_pro/client/connection.rb +94 -0
- data/lib/knapsack_pro/config/ci/base.rb +22 -0
- data/lib/knapsack_pro/config/ci/buildkite.rb +27 -0
- data/lib/knapsack_pro/config/ci/circle.rb +29 -0
- data/lib/knapsack_pro/config/ci/semaphore.rb +28 -0
- data/lib/knapsack_pro/config/env.rb +111 -0
- data/lib/knapsack_pro/logger_wrapper.rb +15 -0
- data/lib/knapsack_pro/presenter.rb +25 -0
- data/lib/knapsack_pro/report.rb +20 -0
- data/lib/knapsack_pro/repository_adapter_initiator.rb +12 -0
- data/lib/knapsack_pro/repository_adapters/base_adapter.rb +14 -0
- data/lib/knapsack_pro/repository_adapters/env_adapter.rb +13 -0
- data/lib/knapsack_pro/repository_adapters/git_adapter.rb +19 -0
- data/lib/knapsack_pro/runners/base_runner.rb +31 -0
- data/lib/knapsack_pro/runners/cucumber_runner.rb +16 -0
- data/lib/knapsack_pro/runners/minitest_runner.rb +26 -0
- data/lib/knapsack_pro/runners/rspec_runner.rb +16 -0
- data/lib/knapsack_pro/task_loader.rb +11 -0
- data/lib/knapsack_pro/test_file_cleaner.rb +7 -0
- data/lib/knapsack_pro/test_file_finder.rb +33 -0
- data/lib/knapsack_pro/test_file_pattern.rb +7 -0
- data/lib/knapsack_pro/test_file_presenter.rb +11 -0
- data/lib/knapsack_pro/test_flat_distributor.rb +84 -0
- data/lib/knapsack_pro/tracker.rb +64 -0
- data/lib/knapsack_pro/version.rb +1 -1
- data/lib/tasks/cucumber.rake +7 -0
- data/lib/tasks/minitest.rake +7 -0
- data/lib/tasks/rspec.rake +7 -0
- data/spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/invalid_test_suite_token.yml +50 -0
- data/spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/success.yml +52 -0
- data/spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/invalid_test_suite_token.yml +50 -0
- data/spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/success.yml +50 -0
- data/spec/integration/api/build_distributions_subset_spec.rb +74 -0
- data/spec/integration/api/build_subsets_create_spec.rb +76 -0
- data/spec/knapsack_pro/adapters/base_adapter_spec.rb +63 -0
- data/spec/knapsack_pro/adapters/cucumber_adapter_spec.rb +71 -0
- data/spec/knapsack_pro/adapters/minitest_adapter_spec.rb +107 -0
- data/spec/knapsack_pro/adapters/rspec_adapter_spec.rb +94 -0
- data/spec/knapsack_pro/allocator_builder_spec.rb +45 -0
- data/spec/knapsack_pro/allocator_spec.rb +80 -0
- data/spec/knapsack_pro/client/api/action_spec.rb +17 -0
- data/spec/knapsack_pro/client/api/v1/base_spec.rb +2 -0
- data/spec/knapsack_pro/client/api/v1/build_distributions_spec.rb +35 -0
- data/spec/knapsack_pro/client/api/v1/build_subsets_spec.rb +35 -0
- data/spec/knapsack_pro/client/connection_spec.rb +138 -0
- data/spec/knapsack_pro/config/ci/base_spec.rb +7 -0
- data/spec/knapsack_pro/config/ci/buildkite_spec.rb +74 -0
- data/spec/knapsack_pro/config/ci/circle_spec.rb +74 -0
- data/spec/knapsack_pro/config/ci/semaphore_spec.rb +74 -0
- data/spec/knapsack_pro/config/env_spec.rb +368 -0
- data/spec/knapsack_pro/logger_wrapper_spec.rb +15 -0
- data/spec/knapsack_pro/presenter_spec.rb +57 -0
- data/spec/knapsack_pro/report_spec.rb +68 -0
- data/spec/knapsack_pro/repository_adapter_initiator_spec.rb +21 -0
- data/spec/knapsack_pro/repository_adapters/base_adapter_spec.rb +13 -0
- data/spec/knapsack_pro/repository_adapters/env_adapter_spec.rb +27 -0
- data/spec/knapsack_pro/repository_adapters/git_adapter_spec.rb +27 -0
- data/spec/knapsack_pro/runners/base_runner_spec.rb +61 -0
- data/spec/knapsack_pro/runners/cucumber_runner_spec.rb +47 -0
- data/spec/knapsack_pro/runners/minitest_runner_spec.rb +34 -0
- data/spec/knapsack_pro/runners/rspec_runner_spec.rb +49 -0
- data/spec/knapsack_pro/task_loader_spec.rb +14 -0
- data/spec/knapsack_pro/test_file_cleaner_spec.rb +11 -0
- data/spec/knapsack_pro/test_file_finder_spec.rb +35 -0
- data/spec/knapsack_pro/test_file_pattern_spec.rb +23 -0
- data/spec/knapsack_pro/test_file_presenter_spec.rb +22 -0
- data/spec/knapsack_pro/test_flat_distributor_spec.rb +60 -0
- data/spec/knapsack_pro/tracker_spec.rb +102 -0
- data/spec/knapsack_pro_spec.rb +56 -0
- data/spec/spec_helper.rb +11 -1
- data/spec/support/fakes/cucumber.rb +12 -0
- data/spec/support/fakes/minitest.rb +12 -0
- data/spec/support/shared_examples/adapter.rb +17 -0
- data/spec_fake/controllers/users_controller_spec.rb +0 -0
- data/spec_fake/models/admin_spec.rb +0 -0
- data/spec_fake/models/user_spec.rb +0 -0
- data/spec_fake/spec_helper.rb +0 -0
- data/test_fake/a_test.rb +0 -0
- data/test_fake/b_test.rb +0 -0
- metadata +212 -12
- data/Gemfile.lock +0 -69
- data/spec/knapsack_spec.rb +0 -3
@@ -0,0 +1,11 @@
|
|
1
|
+
describe KnapsackPro::TestFileCleaner do
|
2
|
+
describe '.clean' do
|
3
|
+
let(:test_file_path) { './models/user_spec.rb' }
|
4
|
+
|
5
|
+
subject { described_class.clean(test_file_path) }
|
6
|
+
|
7
|
+
it 'removes ./ from the begining of the test file path' do
|
8
|
+
expect(subject).to eq 'models/user_spec.rb'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
describe KnapsackPro::TestFileFinder do
|
2
|
+
describe '.call' do
|
3
|
+
let(:test_file_pattern) { double }
|
4
|
+
let(:test_files) { double }
|
5
|
+
|
6
|
+
subject { described_class.call(test_file_pattern) }
|
7
|
+
|
8
|
+
before do
|
9
|
+
test_file_finder = instance_double(described_class, call: test_files)
|
10
|
+
expect(described_class).to receive(:new).with(test_file_pattern).and_return(test_file_finder)
|
11
|
+
end
|
12
|
+
|
13
|
+
it { should eq test_files }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#call' do
|
17
|
+
let(:test_file_pattern) { 'spec_fake/**/*_spec.rb' }
|
18
|
+
|
19
|
+
subject { described_class.new(test_file_pattern).call }
|
20
|
+
|
21
|
+
it do
|
22
|
+
should eq([
|
23
|
+
{
|
24
|
+
'path' => 'spec_fake/controllers/users_controller_spec.rb',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
'path' => 'spec_fake/models/admin_spec.rb',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
'path' => 'spec_fake/models/user_spec.rb',
|
31
|
+
},
|
32
|
+
])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
describe KnapsackPro::TestFilePattern do
|
2
|
+
describe '.call' do
|
3
|
+
let(:adapter_class) { KnapsackPro::Adapters::BaseAdapter }
|
4
|
+
|
5
|
+
subject { described_class.call(adapter_class) }
|
6
|
+
|
7
|
+
before do
|
8
|
+
expect(KnapsackPro::Config::Env).to receive(:test_file_pattern).and_return(env_test_file_pattern)
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'when ENV defined' do
|
12
|
+
let(:env_test_file_pattern) { 'spec/**/*_spec.rb' }
|
13
|
+
|
14
|
+
it { should eq env_test_file_pattern }
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when ENV not defined' do
|
18
|
+
let(:env_test_file_pattern) { nil }
|
19
|
+
|
20
|
+
it { should eq 'test/**/*_test.rb' }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
describe KnapsackPro::TestFilePresenter do
|
2
|
+
describe '.stringify_paths' do
|
3
|
+
let(:test_file_paths) { ['a_spec.rb', 'b_spec.rb'] }
|
4
|
+
|
5
|
+
subject { described_class.stringify_paths(test_file_paths) }
|
6
|
+
|
7
|
+
it { should eq 'a_spec.rb b_spec.rb' }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '.paths' do
|
11
|
+
let(:test_files) do
|
12
|
+
[
|
13
|
+
{ 'path' => 'a_spec.rb' },
|
14
|
+
{ 'path' => 'b_spec.rb' },
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
subject { described_class.paths(test_files) }
|
19
|
+
|
20
|
+
it { should eq ['a_spec.rb', 'b_spec.rb'] }
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
describe KnapsackPro::TestFlatDistributor do
|
2
|
+
let(:test_flat_distributor) { described_class.new(test_files, node_total) }
|
3
|
+
let(:node_total) { 2 }
|
4
|
+
let(:test_files) do
|
5
|
+
[
|
6
|
+
{ 'path' => 'spec/dir1/a_spec.rb' },
|
7
|
+
{ 'path' => 'spec/dir2/a_spec.rb' },
|
8
|
+
{ 'path' => 'spec/dir3/a_spec.rb' },
|
9
|
+
{ 'path' => 'spec/feature/e_spec.rb' },
|
10
|
+
{ 'path' => 'spec/models/b_spec.rb' },
|
11
|
+
{ 'path' => 'spec/feature/c_spec.rb' },
|
12
|
+
{ 'path' => 'spec/models/d_spec.rb' },
|
13
|
+
{ 'path' => 'spec/feature/a_spec.rb' },
|
14
|
+
{ 'path' => 'spec/models/f_spec.rb' },
|
15
|
+
{ 'path' => 'spec/models/g_spec.rb' },
|
16
|
+
{ 'path' => 'spec/dir4/h_spec.rb' },
|
17
|
+
{ 'path' => 'spec/models/i_spec.rb' },
|
18
|
+
]
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#nodes' do
|
22
|
+
subject { test_flat_distributor.nodes }
|
23
|
+
|
24
|
+
it do
|
25
|
+
should eq({
|
26
|
+
0 => [
|
27
|
+
{ 'path' => 'spec/feature/a_spec.rb' },
|
28
|
+
{ 'path' => 'spec/feature/e_spec.rb' },
|
29
|
+
{ 'path' => 'spec/models/d_spec.rb' },
|
30
|
+
{ 'path' => 'spec/models/g_spec.rb' },
|
31
|
+
{ 'path' => 'spec/dir1/a_spec.rb' },
|
32
|
+
{ 'path' => 'spec/dir3/a_spec.rb' },
|
33
|
+
],
|
34
|
+
1 => [
|
35
|
+
{ 'path' => 'spec/feature/c_spec.rb' },
|
36
|
+
{ 'path' => 'spec/models/b_spec.rb' },
|
37
|
+
{ 'path' => 'spec/models/f_spec.rb' },
|
38
|
+
{ 'path' => 'spec/models/i_spec.rb' },
|
39
|
+
{ 'path' => 'spec/dir2/a_spec.rb' },
|
40
|
+
{ 'path' => 'spec/dir4/h_spec.rb' },
|
41
|
+
],
|
42
|
+
})
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#test_files_for_node' do
|
47
|
+
subject { test_flat_distributor.test_files_for_node(1) }
|
48
|
+
|
49
|
+
it do
|
50
|
+
should eq([
|
51
|
+
{ 'path' => 'spec/feature/c_spec.rb' },
|
52
|
+
{ 'path' => 'spec/models/b_spec.rb' },
|
53
|
+
{ 'path' => 'spec/models/f_spec.rb' },
|
54
|
+
{ 'path' => 'spec/models/i_spec.rb' },
|
55
|
+
{ 'path' => 'spec/dir2/a_spec.rb' },
|
56
|
+
{ 'path' => 'spec/dir4/h_spec.rb' },
|
57
|
+
])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
shared_examples 'default trakcer attributes' do
|
2
|
+
it { expect(tracker.global_time).to eql 0 }
|
3
|
+
it { expect(tracker.test_files_with_time).to eql({}) }
|
4
|
+
end
|
5
|
+
|
6
|
+
describe KnapsackPro::Tracker do
|
7
|
+
let(:tracker) { described_class.send(:new) }
|
8
|
+
|
9
|
+
it_behaves_like 'default trakcer attributes'
|
10
|
+
|
11
|
+
describe '#current_test_path' do
|
12
|
+
subject { tracker.current_test_path }
|
13
|
+
|
14
|
+
context 'when current_test_path not set' do
|
15
|
+
it do
|
16
|
+
expect { subject }.to raise_error("current_test_path needs to be set by Knapsack Pro Adapter's bind method")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when current_test_path set' do
|
21
|
+
context 'when current_test_path has prefix ./' do
|
22
|
+
before { tracker.current_test_path = './spec/models/user_spec.rb' }
|
23
|
+
it { should eql 'spec/models/user_spec.rb' }
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when current_test_path has no prefix ./' do
|
27
|
+
before { tracker.current_test_path = 'spec/models/user_spec.rb' }
|
28
|
+
it { should eql 'spec/models/user_spec.rb' }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'track time execution' do
|
34
|
+
let(:test_paths) { ['a_spec.rb', 'b_spec.rb'] }
|
35
|
+
let(:delta) { 0.02 }
|
36
|
+
|
37
|
+
shared_examples '#to_a' do
|
38
|
+
subject { tracker.to_a }
|
39
|
+
|
40
|
+
its(:size) { should eq 2 }
|
41
|
+
it { expect(subject[0][:path]).to eq 'a_spec.rb' }
|
42
|
+
it { expect(subject[0][:time_execution]).to be >= 0 }
|
43
|
+
it { expect(subject[1][:path]).to eq 'b_spec.rb' }
|
44
|
+
it { expect(subject[1][:time_execution]).to be >= 0 }
|
45
|
+
end
|
46
|
+
|
47
|
+
context 'without Timecop' do
|
48
|
+
before do
|
49
|
+
test_paths.each_with_index do |test_path, index|
|
50
|
+
tracker.current_test_path = test_path
|
51
|
+
tracker.start_timer
|
52
|
+
sleep index.to_f / 10 + 0.1
|
53
|
+
tracker.stop_timer
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it { expect(tracker.global_time).to be_within(delta).of(0.3) }
|
58
|
+
it { expect(tracker.test_files_with_time.keys.size).to eql 2 }
|
59
|
+
it { expect(tracker.test_files_with_time['a_spec.rb']).to be_within(delta).of(0.1) }
|
60
|
+
it { expect(tracker.test_files_with_time['b_spec.rb']).to be_within(delta).of(0.2) }
|
61
|
+
it_behaves_like '#to_a'
|
62
|
+
end
|
63
|
+
|
64
|
+
context "with Timecop - Timecop shouldn't have impact on measured test time" do
|
65
|
+
let(:now) { Time.now }
|
66
|
+
|
67
|
+
before do
|
68
|
+
test_paths.each_with_index do |test_path, index|
|
69
|
+
Timecop.freeze(now) do
|
70
|
+
tracker.current_test_path = test_path
|
71
|
+
tracker.start_timer
|
72
|
+
end
|
73
|
+
|
74
|
+
delay = index + 1
|
75
|
+
Timecop.freeze(now+delay) do
|
76
|
+
tracker.stop_timer
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
it { expect(tracker.global_time).to be > 0 }
|
82
|
+
it { expect(tracker.global_time).to be_within(delta).of(0) }
|
83
|
+
it { expect(tracker.test_files_with_time.keys.size).to eql 2 }
|
84
|
+
it { expect(tracker.test_files_with_time['a_spec.rb']).to be_within(delta).of(0) }
|
85
|
+
it { expect(tracker.test_files_with_time['b_spec.rb']).to be_within(delta).of(0) }
|
86
|
+
it_behaves_like '#to_a'
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#reset!' do
|
91
|
+
before do
|
92
|
+
tracker.current_test_path = 'a_spec.rb'
|
93
|
+
tracker.start_timer
|
94
|
+
sleep 0.1
|
95
|
+
tracker.stop_timer
|
96
|
+
expect(tracker.global_time).not_to eql 0
|
97
|
+
tracker.reset!
|
98
|
+
end
|
99
|
+
|
100
|
+
it_behaves_like 'default trakcer attributes'
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
describe KnapsackPro do
|
2
|
+
describe '.root' do
|
3
|
+
subject { described_class.root }
|
4
|
+
|
5
|
+
it { expect(subject).to match 'knapsack' }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '.logger' do
|
9
|
+
let(:logger_wrapper) { double }
|
10
|
+
|
11
|
+
subject { described_class.logger }
|
12
|
+
|
13
|
+
before { described_class.reset_logger! }
|
14
|
+
after { described_class.reset_logger! }
|
15
|
+
|
16
|
+
context 'when default logger' do
|
17
|
+
let(:logger) { instance_double(Logger) }
|
18
|
+
|
19
|
+
before do
|
20
|
+
expect(Logger).to receive(:new).with(STDOUT).and_return(logger)
|
21
|
+
expect(logger).to receive(:level=).with(Logger::INFO)
|
22
|
+
expect(KnapsackPro::LoggerWrapper).to receive(:new).with(logger).and_return(logger_wrapper)
|
23
|
+
end
|
24
|
+
|
25
|
+
it { should eql logger_wrapper }
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when custom logger' do
|
29
|
+
let(:logger) { double('custom logger') }
|
30
|
+
|
31
|
+
before do
|
32
|
+
expect(KnapsackPro::LoggerWrapper).to receive(:new).with(logger).and_return(logger_wrapper)
|
33
|
+
described_class.logger = logger
|
34
|
+
end
|
35
|
+
|
36
|
+
it { should eql logger_wrapper }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '.tracker' do
|
41
|
+
subject { described_class.tracker }
|
42
|
+
|
43
|
+
it { should be_a KnapsackPro::Tracker }
|
44
|
+
it { expect(subject.object_id).to eql described_class.tracker.object_id }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '.load_tasks' do
|
48
|
+
let(:task_loader) { instance_double(KnapsackPro::TaskLoader) }
|
49
|
+
|
50
|
+
it do
|
51
|
+
expect(KnapsackPro::TaskLoader).to receive(:new).and_return(task_loader)
|
52
|
+
expect(task_loader).to receive(:load_tasks)
|
53
|
+
described_class.load_tasks
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,22 @@
|
|
1
|
+
require 'rspec/its'
|
2
|
+
|
1
3
|
require 'timecop'
|
2
4
|
Timecop.safe_mode = true
|
3
5
|
|
4
6
|
require 'codeclimate-test-reporter'
|
5
7
|
CodeClimate::TestReporter.start
|
6
8
|
|
9
|
+
require 'vcr'
|
10
|
+
require 'webmock/rspec'
|
11
|
+
VCR.configure do |config|
|
12
|
+
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
13
|
+
config.hook_into :webmock # or :fakeweb
|
14
|
+
config.ignore_hosts 'codeclimate.com'
|
15
|
+
end
|
16
|
+
|
7
17
|
require 'knapsack_pro'
|
8
18
|
|
9
|
-
Dir["#{KnapsackPro.root}/spec/support/**/*.rb"].each { |f| require f }
|
19
|
+
Dir["#{KnapsackPro.root}/spec/{support,fixtures}/**/*.rb"].each { |f| require f }
|
10
20
|
|
11
21
|
RSpec.configure do |config|
|
12
22
|
config.order = :random
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# https://github.com/seattlerb/minitest/blob/master/lib/minitest/test.rb
|
2
|
+
module Minitest
|
3
|
+
class Test
|
4
|
+
def before_setup; end
|
5
|
+
def after_teardown; end
|
6
|
+
end
|
7
|
+
|
8
|
+
# https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb
|
9
|
+
def self.after_run(&block)
|
10
|
+
block.call
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
shared_examples 'adapter' do
|
2
|
+
describe '#bind_time_tracker' do
|
3
|
+
it do
|
4
|
+
expect {
|
5
|
+
subject.bind_time_tracker
|
6
|
+
}.not_to raise_error
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#bind_save_report' do
|
11
|
+
it do
|
12
|
+
expect {
|
13
|
+
subject.bind_save_report
|
14
|
+
}.not_to raise_error
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test_fake/a_test.rb
ADDED
File without changes
|
data/test_fake/b_test.rb
ADDED
File without changes
|
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: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -24,6 +24,34 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.2.8
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.2.8
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: timecop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.0
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: bundler
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,6 +86,20 @@ dependencies:
|
|
58
86
|
- - ">="
|
59
87
|
- !ruby/object:Gem::Version
|
60
88
|
version: 2.0.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec-its
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.2'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.2'
|
61
103
|
- !ruby/object:Gem::Dependency
|
62
104
|
name: cucumber
|
63
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,19 +115,19 @@ dependencies:
|
|
73
115
|
- !ruby/object:Gem::Version
|
74
116
|
version: '1.3'
|
75
117
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
118
|
+
name: minitest
|
77
119
|
requirement: !ruby/object:Gem::Requirement
|
78
120
|
requirements:
|
79
|
-
- - "
|
121
|
+
- - ">="
|
80
122
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
123
|
+
version: 5.0.0
|
82
124
|
type: :development
|
83
125
|
prerelease: false
|
84
126
|
version_requirements: !ruby/object:Gem::Requirement
|
85
127
|
requirements:
|
86
|
-
- - "
|
128
|
+
- - ">="
|
87
129
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
130
|
+
version: 5.0.0
|
89
131
|
- !ruby/object:Gem::Dependency
|
90
132
|
name: codeclimate-test-reporter
|
91
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,11 +156,40 @@ dependencies:
|
|
114
156
|
- - "~>"
|
115
157
|
- !ruby/object:Gem::Version
|
116
158
|
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: vcr
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '2.9'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '2.9'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: webmock
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '1.21'
|
180
|
+
type: :development
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - "~>"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '1.21'
|
117
187
|
description: Parallel tests across CI server nodes based on each test file's time
|
118
188
|
execution. It uses KnapsackPro.com API.
|
119
189
|
email:
|
120
190
|
- arturtrzop@gmail.com
|
121
|
-
executables:
|
191
|
+
executables:
|
192
|
+
- knapsack_pro
|
122
193
|
extensions: []
|
123
194
|
extra_rdoc_files: []
|
124
195
|
files:
|
@@ -126,17 +197,103 @@ files:
|
|
126
197
|
- ".rspec"
|
127
198
|
- CHANGELOG.md
|
128
199
|
- Gemfile
|
129
|
-
- Gemfile.lock
|
130
200
|
- LICENSE
|
131
201
|
- README.md
|
132
202
|
- Rakefile
|
203
|
+
- bin/knapsack_pro
|
133
204
|
- circle.yml
|
134
205
|
- knapsack_pro.gemspec
|
135
206
|
- lib/knapsack_pro.rb
|
207
|
+
- lib/knapsack_pro/adapters/base_adapter.rb
|
208
|
+
- lib/knapsack_pro/adapters/cucumber_adapter.rb
|
209
|
+
- lib/knapsack_pro/adapters/minitest_adapter.rb
|
210
|
+
- lib/knapsack_pro/adapters/rspec_adapter.rb
|
211
|
+
- lib/knapsack_pro/allocator.rb
|
212
|
+
- lib/knapsack_pro/allocator_builder.rb
|
213
|
+
- lib/knapsack_pro/client/api/action.rb
|
214
|
+
- lib/knapsack_pro/client/api/v1/base.rb
|
215
|
+
- lib/knapsack_pro/client/api/v1/build_distributions.rb
|
216
|
+
- lib/knapsack_pro/client/api/v1/build_subsets.rb
|
217
|
+
- lib/knapsack_pro/client/connection.rb
|
218
|
+
- lib/knapsack_pro/config/ci/base.rb
|
219
|
+
- lib/knapsack_pro/config/ci/buildkite.rb
|
220
|
+
- lib/knapsack_pro/config/ci/circle.rb
|
221
|
+
- lib/knapsack_pro/config/ci/semaphore.rb
|
222
|
+
- lib/knapsack_pro/config/env.rb
|
223
|
+
- lib/knapsack_pro/logger_wrapper.rb
|
224
|
+
- lib/knapsack_pro/presenter.rb
|
225
|
+
- lib/knapsack_pro/report.rb
|
226
|
+
- lib/knapsack_pro/repository_adapter_initiator.rb
|
227
|
+
- lib/knapsack_pro/repository_adapters/base_adapter.rb
|
228
|
+
- lib/knapsack_pro/repository_adapters/env_adapter.rb
|
229
|
+
- lib/knapsack_pro/repository_adapters/git_adapter.rb
|
230
|
+
- lib/knapsack_pro/runners/base_runner.rb
|
231
|
+
- lib/knapsack_pro/runners/cucumber_runner.rb
|
232
|
+
- lib/knapsack_pro/runners/minitest_runner.rb
|
233
|
+
- lib/knapsack_pro/runners/rspec_runner.rb
|
234
|
+
- lib/knapsack_pro/task_loader.rb
|
235
|
+
- lib/knapsack_pro/test_file_cleaner.rb
|
236
|
+
- lib/knapsack_pro/test_file_finder.rb
|
237
|
+
- lib/knapsack_pro/test_file_pattern.rb
|
238
|
+
- lib/knapsack_pro/test_file_presenter.rb
|
239
|
+
- lib/knapsack_pro/test_flat_distributor.rb
|
240
|
+
- lib/knapsack_pro/tracker.rb
|
136
241
|
- lib/knapsack_pro/version.rb
|
137
|
-
-
|
242
|
+
- lib/tasks/cucumber.rake
|
243
|
+
- lib/tasks/minitest.rake
|
244
|
+
- lib/tasks/rspec.rake
|
245
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/invalid_test_suite_token.yml
|
246
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/success.yml
|
247
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/invalid_test_suite_token.yml
|
248
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/success.yml
|
249
|
+
- spec/integration/api/build_distributions_subset_spec.rb
|
250
|
+
- spec/integration/api/build_subsets_create_spec.rb
|
251
|
+
- spec/knapsack_pro/adapters/base_adapter_spec.rb
|
252
|
+
- spec/knapsack_pro/adapters/cucumber_adapter_spec.rb
|
253
|
+
- spec/knapsack_pro/adapters/minitest_adapter_spec.rb
|
254
|
+
- spec/knapsack_pro/adapters/rspec_adapter_spec.rb
|
255
|
+
- spec/knapsack_pro/allocator_builder_spec.rb
|
256
|
+
- spec/knapsack_pro/allocator_spec.rb
|
257
|
+
- spec/knapsack_pro/client/api/action_spec.rb
|
258
|
+
- spec/knapsack_pro/client/api/v1/base_spec.rb
|
259
|
+
- spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
|
260
|
+
- spec/knapsack_pro/client/api/v1/build_subsets_spec.rb
|
261
|
+
- spec/knapsack_pro/client/connection_spec.rb
|
262
|
+
- spec/knapsack_pro/config/ci/base_spec.rb
|
263
|
+
- spec/knapsack_pro/config/ci/buildkite_spec.rb
|
264
|
+
- spec/knapsack_pro/config/ci/circle_spec.rb
|
265
|
+
- spec/knapsack_pro/config/ci/semaphore_spec.rb
|
266
|
+
- spec/knapsack_pro/config/env_spec.rb
|
267
|
+
- spec/knapsack_pro/logger_wrapper_spec.rb
|
268
|
+
- spec/knapsack_pro/presenter_spec.rb
|
269
|
+
- spec/knapsack_pro/report_spec.rb
|
270
|
+
- spec/knapsack_pro/repository_adapter_initiator_spec.rb
|
271
|
+
- spec/knapsack_pro/repository_adapters/base_adapter_spec.rb
|
272
|
+
- spec/knapsack_pro/repository_adapters/env_adapter_spec.rb
|
273
|
+
- spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
|
274
|
+
- spec/knapsack_pro/runners/base_runner_spec.rb
|
275
|
+
- spec/knapsack_pro/runners/cucumber_runner_spec.rb
|
276
|
+
- spec/knapsack_pro/runners/minitest_runner_spec.rb
|
277
|
+
- spec/knapsack_pro/runners/rspec_runner_spec.rb
|
278
|
+
- spec/knapsack_pro/task_loader_spec.rb
|
279
|
+
- spec/knapsack_pro/test_file_cleaner_spec.rb
|
280
|
+
- spec/knapsack_pro/test_file_finder_spec.rb
|
281
|
+
- spec/knapsack_pro/test_file_pattern_spec.rb
|
282
|
+
- spec/knapsack_pro/test_file_presenter_spec.rb
|
283
|
+
- spec/knapsack_pro/test_flat_distributor_spec.rb
|
284
|
+
- spec/knapsack_pro/tracker_spec.rb
|
285
|
+
- spec/knapsack_pro_spec.rb
|
138
286
|
- spec/spec_helper.rb
|
139
287
|
- spec/support/.gitkeep
|
288
|
+
- spec/support/fakes/cucumber.rb
|
289
|
+
- spec/support/fakes/minitest.rb
|
290
|
+
- spec/support/shared_examples/adapter.rb
|
291
|
+
- spec_fake/controllers/users_controller_spec.rb
|
292
|
+
- spec_fake/models/admin_spec.rb
|
293
|
+
- spec_fake/models/user_spec.rb
|
294
|
+
- spec_fake/spec_helper.rb
|
295
|
+
- test_fake/a_test.rb
|
296
|
+
- test_fake/b_test.rb
|
140
297
|
homepage: https://github.com/KnapsackPro/knapsack_pro-ruby
|
141
298
|
licenses:
|
142
299
|
- LGPLv3
|
@@ -157,12 +314,55 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
314
|
version: '0'
|
158
315
|
requirements: []
|
159
316
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.4.
|
317
|
+
rubygems_version: 2.4.5.1
|
161
318
|
signing_key:
|
162
319
|
specification_version: 4
|
163
320
|
summary: Knapsack Pro splits tests across CI nodes and makes sure that tests will
|
164
321
|
run comparable time on each node.
|
165
322
|
test_files:
|
166
|
-
- spec/
|
323
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/invalid_test_suite_token.yml
|
324
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/success.yml
|
325
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/invalid_test_suite_token.yml
|
326
|
+
- spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/success.yml
|
327
|
+
- spec/integration/api/build_distributions_subset_spec.rb
|
328
|
+
- spec/integration/api/build_subsets_create_spec.rb
|
329
|
+
- spec/knapsack_pro/adapters/base_adapter_spec.rb
|
330
|
+
- spec/knapsack_pro/adapters/cucumber_adapter_spec.rb
|
331
|
+
- spec/knapsack_pro/adapters/minitest_adapter_spec.rb
|
332
|
+
- spec/knapsack_pro/adapters/rspec_adapter_spec.rb
|
333
|
+
- spec/knapsack_pro/allocator_builder_spec.rb
|
334
|
+
- spec/knapsack_pro/allocator_spec.rb
|
335
|
+
- spec/knapsack_pro/client/api/action_spec.rb
|
336
|
+
- spec/knapsack_pro/client/api/v1/base_spec.rb
|
337
|
+
- spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
|
338
|
+
- spec/knapsack_pro/client/api/v1/build_subsets_spec.rb
|
339
|
+
- spec/knapsack_pro/client/connection_spec.rb
|
340
|
+
- spec/knapsack_pro/config/ci/base_spec.rb
|
341
|
+
- spec/knapsack_pro/config/ci/buildkite_spec.rb
|
342
|
+
- spec/knapsack_pro/config/ci/circle_spec.rb
|
343
|
+
- spec/knapsack_pro/config/ci/semaphore_spec.rb
|
344
|
+
- spec/knapsack_pro/config/env_spec.rb
|
345
|
+
- spec/knapsack_pro/logger_wrapper_spec.rb
|
346
|
+
- spec/knapsack_pro/presenter_spec.rb
|
347
|
+
- spec/knapsack_pro/report_spec.rb
|
348
|
+
- spec/knapsack_pro/repository_adapter_initiator_spec.rb
|
349
|
+
- spec/knapsack_pro/repository_adapters/base_adapter_spec.rb
|
350
|
+
- spec/knapsack_pro/repository_adapters/env_adapter_spec.rb
|
351
|
+
- spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
|
352
|
+
- spec/knapsack_pro/runners/base_runner_spec.rb
|
353
|
+
- spec/knapsack_pro/runners/cucumber_runner_spec.rb
|
354
|
+
- spec/knapsack_pro/runners/minitest_runner_spec.rb
|
355
|
+
- spec/knapsack_pro/runners/rspec_runner_spec.rb
|
356
|
+
- spec/knapsack_pro/task_loader_spec.rb
|
357
|
+
- spec/knapsack_pro/test_file_cleaner_spec.rb
|
358
|
+
- spec/knapsack_pro/test_file_finder_spec.rb
|
359
|
+
- spec/knapsack_pro/test_file_pattern_spec.rb
|
360
|
+
- spec/knapsack_pro/test_file_presenter_spec.rb
|
361
|
+
- spec/knapsack_pro/test_flat_distributor_spec.rb
|
362
|
+
- spec/knapsack_pro/tracker_spec.rb
|
363
|
+
- spec/knapsack_pro_spec.rb
|
167
364
|
- spec/spec_helper.rb
|
168
365
|
- spec/support/.gitkeep
|
366
|
+
- spec/support/fakes/cucumber.rb
|
367
|
+
- spec/support/fakes/minitest.rb
|
368
|
+
- spec/support/shared_examples/adapter.rb
|