knapsack_pro 9.0.0 → 9.1.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 +4 -4
- data/lib/knapsack_pro/adapters/minitest_adapter.rb +8 -13
- data/lib/knapsack_pro/client/connection.rb +1 -1
- data/lib/knapsack_pro/config/env.rb +1 -24
- data/lib/knapsack_pro/version.rb +1 -1
- metadata +2 -196
- data/.circleci/config.yml +0 -468
- data/.github/assets/install-button.png +0 -0
- data/.github/assets/knapsack-diamonds.png +0 -0
- data/.github/dependabot.yml +0 -11
- data/.github/pull_request_template.md +0 -11
- data/.gitignore +0 -39
- data/.rspec +0 -5
- data/CHANGELOG.md +0 -1995
- data/Gemfile +0 -13
- data/LICENSE +0 -22
- data/README.md +0 -90
- data/Rakefile +0 -2
- data/knapsack_pro.gemspec +0 -43
- data/spec/fixtures/test_file_list_source_file.txt +0 -6
- data/spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/invalid_test_suite_token.yml +0 -59
- data/spec/fixtures/vcr_cassettes/api/v1/build_distributions/subset/success.yml +0 -61
- data/spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/invalid_test_suite_token.yml +0 -50
- data/spec/fixtures/vcr_cassettes/api/v1/build_subsets/create/success.yml +0 -50
- data/spec/integration/api/build_distributions_subset_spec.rb +0 -77
- data/spec/integration/api/build_subsets_create_spec.rb +0 -77
- data/spec/integration/runners/fallback_spec.rb +0 -131
- data/spec/integration/runners/queue/cucumber_runner_fallback_spec.rb +0 -129
- data/spec/integration/runners/queue/minitest_runner_fallback_spec.rb +0 -129
- data/spec/integration/runners/queue/rspec_runner.rb +0 -80
- data/spec/integration/runners/queue/rspec_runner_fallback_spec.rb +0 -137
- data/spec/integration/runners/queue/rspec_runner_spec.rb +0 -2672
- data/spec/knapsack_pro/adapters/base_adapter_spec.rb +0 -221
- data/spec/knapsack_pro/adapters/cucumber_adapter_spec.rb +0 -216
- data/spec/knapsack_pro/adapters/minitest_adapter_spec.rb +0 -189
- data/spec/knapsack_pro/adapters/rspec_adapter_spec.rb +0 -427
- data/spec/knapsack_pro/adapters/spinach_adapter_spec.rb +0 -61
- data/spec/knapsack_pro/adapters/test_unit_adapter_spec.rb +0 -86
- data/spec/knapsack_pro/base_allocator_builder_spec.rb +0 -102
- data/spec/knapsack_pro/build_distribution_fetcher_spec.rb +0 -89
- data/spec/knapsack_pro/client/api/action_spec.rb +0 -17
- data/spec/knapsack_pro/client/api/v1/base_spec.rb +0 -2
- data/spec/knapsack_pro/client/api/v1/build_distributions_spec.rb +0 -95
- data/spec/knapsack_pro/client/api/v1/build_subsets_spec.rb +0 -35
- data/spec/knapsack_pro/client/api/v1/queues_spec.rb +0 -83
- data/spec/knapsack_pro/client/connection_spec.rb +0 -581
- data/spec/knapsack_pro/config/ci/app_veyor_spec.rb +0 -87
- data/spec/knapsack_pro/config/ci/base_spec.rb +0 -10
- data/spec/knapsack_pro/config/ci/buildkite_spec.rb +0 -135
- data/spec/knapsack_pro/config/ci/circle_spec.rb +0 -122
- data/spec/knapsack_pro/config/ci/cirrus_ci_spec.rb +0 -87
- data/spec/knapsack_pro/config/ci/codefresh_spec.rb +0 -81
- data/spec/knapsack_pro/config/ci/codeship_spec.rb +0 -80
- data/spec/knapsack_pro/config/ci/github_actions_spec.rb +0 -140
- data/spec/knapsack_pro/config/ci/gitlab_ci_spec.rb +0 -137
- data/spec/knapsack_pro/config/ci/heroku_spec.rb +0 -87
- data/spec/knapsack_pro/config/ci/semaphore2_spec.rb +0 -133
- data/spec/knapsack_pro/config/ci/semaphore_spec.rb +0 -87
- data/spec/knapsack_pro/config/ci/travis_spec.rb +0 -73
- data/spec/knapsack_pro/config/env_generator_spec.rb +0 -52
- data/spec/knapsack_pro/config/env_spec.rb +0 -1291
- data/spec/knapsack_pro/config/temp_files_spec.rb +0 -25
- data/spec/knapsack_pro/crypto/branch_encryptor_spec.rb +0 -53
- data/spec/knapsack_pro/crypto/decryptor_spec.rb +0 -83
- data/spec/knapsack_pro/crypto/digestor_spec.rb +0 -13
- data/spec/knapsack_pro/crypto/encryptor_spec.rb +0 -58
- data/spec/knapsack_pro/formatters/time_tracker_fetcher_spec.rb +0 -27
- data/spec/knapsack_pro/formatters/time_tracker_spec.rb +0 -448
- data/spec/knapsack_pro/hooks/queue_spec.rb +0 -199
- data/spec/knapsack_pro/presenter_spec.rb +0 -57
- data/spec/knapsack_pro/pure/queue/rspec_pure_spec.rb +0 -248
- data/spec/knapsack_pro/queue_spec.rb +0 -35
- data/spec/knapsack_pro/report_spec.rb +0 -232
- data/spec/knapsack_pro/repository_adapter_initiator_spec.rb +0 -21
- data/spec/knapsack_pro/repository_adapters/base_adapter_spec.rb +0 -13
- data/spec/knapsack_pro/repository_adapters/env_adapter_spec.rb +0 -27
- data/spec/knapsack_pro/repository_adapters/git_adapter_spec.rb +0 -106
- data/spec/knapsack_pro/runners/base_runner_spec.rb +0 -87
- data/spec/knapsack_pro/runners/cucumber_runner_spec.rb +0 -92
- data/spec/knapsack_pro/runners/minitest_runner_spec.rb +0 -57
- data/spec/knapsack_pro/runners/queue/base_runner_spec.rb +0 -73
- data/spec/knapsack_pro/runners/queue/cucumber_runner_spec.rb +0 -209
- data/spec/knapsack_pro/runners/queue/minitest_runner_spec.rb +0 -203
- data/spec/knapsack_pro/runners/rspec_runner_spec.rb +0 -111
- data/spec/knapsack_pro/runners/spinach_runner_spec.rb +0 -56
- data/spec/knapsack_pro/runners/test_unit_runner_spec.rb +0 -62
- data/spec/knapsack_pro/slow_test_file_determiner_spec.rb +0 -119
- data/spec/knapsack_pro/slow_test_file_finder_spec.rb +0 -42
- data/spec/knapsack_pro/task_loader_spec.rb +0 -14
- data/spec/knapsack_pro/test_case_detectors/rspec_test_example_detector_spec.rb +0 -217
- data/spec/knapsack_pro/test_case_mergers/base_merger_spec.rb +0 -27
- data/spec/knapsack_pro/test_case_mergers/rspec_merger_spec.rb +0 -81
- data/spec/knapsack_pro/test_file_cleaner_spec.rb +0 -11
- data/spec/knapsack_pro/test_file_finder_spec.rb +0 -176
- data/spec/knapsack_pro/test_file_pattern_spec.rb +0 -49
- data/spec/knapsack_pro/test_file_presenter_spec.rb +0 -22
- data/spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb +0 -41
- data/spec/knapsack_pro/test_flat_distributor_spec.rb +0 -60
- data/spec/knapsack_pro/tracker_spec.rb +0 -184
- data/spec/knapsack_pro/utils_spec.rb +0 -55
- data/spec/knapsack_pro_spec.rb +0 -116
- data/spec/spec_helper.rb +0 -47
- data/spec/support/.gitkeep +0 -0
- data/spec/support/fakes/cucumber.rb +0 -25
- data/spec/support/fakes/minitest.rb +0 -18
- data/spec/support/shared_examples/adapter.rb +0 -17
- 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/spec_time_tracker/spec_helper.rb +0 -29
- data/test_fake/a_test.rb +0 -0
- data/test_fake/b_test.rb +0 -0
data/spec/knapsack_pro_spec.rb
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
require 'tmpdir'
|
|
2
|
-
|
|
3
|
-
describe KnapsackPro do
|
|
4
|
-
describe '.root' do
|
|
5
|
-
subject { described_class.root }
|
|
6
|
-
|
|
7
|
-
it { expect(subject).to match 'knapsack_pro-ruby' }
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe '.logger' do
|
|
11
|
-
subject { described_class.logger }
|
|
12
|
-
|
|
13
|
-
before(:each) do
|
|
14
|
-
described_class.reset_logger!
|
|
15
|
-
KnapsackPro::Config::Env.remove_instance_variable(:@ci_node_index) if KnapsackPro::Config::Env.instance_variable_defined?(:@ci_node_index)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
after { described_class.reset_logger! }
|
|
19
|
-
|
|
20
|
-
context 'when KNAPSACK_PRO_LOG_DIR is set' do
|
|
21
|
-
context 'when KNAPSACK_PRO_CI_NODE_INDEX is set' do
|
|
22
|
-
it 'logs to a file in that dir named after the node index' do
|
|
23
|
-
Dir.mktmpdir do |dir|
|
|
24
|
-
stub_const('ENV', 'KNAPSACK_PRO_LOG_DIR' => dir, 'KNAPSACK_PRO_CI_NODE_INDEX' => 1)
|
|
25
|
-
|
|
26
|
-
KnapsackPro.logger.debug 'debug'
|
|
27
|
-
KnapsackPro.logger.info 'info'
|
|
28
|
-
KnapsackPro.logger.warn 'warn'
|
|
29
|
-
|
|
30
|
-
log = File.read "#{dir}/knapsack_pro_node_1.log"
|
|
31
|
-
expect(log).not_to include('DEBUG -- knapsack_pro: debug')
|
|
32
|
-
expect(log).to include('INFO -- knapsack_pro: info')
|
|
33
|
-
expect(log).to include('WARN -- knapsack_pro: warn')
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
context 'when KNAPSACK_PRO_CI_NODE_INDEX is not set' do
|
|
39
|
-
it 'logs to a file in that dir named after node index 0' do
|
|
40
|
-
Dir.mktmpdir do |dir|
|
|
41
|
-
stub_const('ENV', 'KNAPSACK_PRO_LOG_DIR' => dir)
|
|
42
|
-
|
|
43
|
-
KnapsackPro.logger.debug 'debug'
|
|
44
|
-
KnapsackPro.logger.info 'info'
|
|
45
|
-
KnapsackPro.logger.warn 'warn'
|
|
46
|
-
|
|
47
|
-
log = File.read "#{dir}/knapsack_pro_node_0.log"
|
|
48
|
-
expect(log).not_to include('DEBUG -- knapsack_pro: debug')
|
|
49
|
-
expect(log).to include('INFO -- knapsack_pro: info')
|
|
50
|
-
expect(log).to include('WARN -- knapsack_pro: warn')
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
context 'with the default logger' do
|
|
57
|
-
it 'ignores debug to stdout' do
|
|
58
|
-
expect do
|
|
59
|
-
KnapsackPro.stdout = $stdout
|
|
60
|
-
KnapsackPro.logger.debug 'debug'
|
|
61
|
-
end
|
|
62
|
-
.not_to output.to_stdout
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'logs info to stdout' do
|
|
66
|
-
expect do
|
|
67
|
-
KnapsackPro.stdout = $stdout
|
|
68
|
-
KnapsackPro.logger.info 'info'
|
|
69
|
-
end
|
|
70
|
-
.to output(/INFO -- knapsack_pro: info/)
|
|
71
|
-
.to_stdout
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it 'logs warn to stdout' do
|
|
75
|
-
expect do
|
|
76
|
-
KnapsackPro.stdout = $stdout
|
|
77
|
-
KnapsackPro.logger.warn 'warn'
|
|
78
|
-
end
|
|
79
|
-
.to output(/WARN -- knapsack_pro: warn/)
|
|
80
|
-
.to_stdout
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
context 'with a custom logger' do
|
|
85
|
-
it 'logs using it' do
|
|
86
|
-
stream = StringIO.new
|
|
87
|
-
KnapsackPro.logger = ::Logger.new(stream)
|
|
88
|
-
|
|
89
|
-
KnapsackPro.logger.debug 'debug'
|
|
90
|
-
KnapsackPro.logger.info 'info'
|
|
91
|
-
KnapsackPro.logger.warn 'warn'
|
|
92
|
-
|
|
93
|
-
expect(stream.string).to include('DEBUG -- knapsack_pro: debug')
|
|
94
|
-
expect(stream.string).to include('INFO -- knapsack_pro: info')
|
|
95
|
-
expect(stream.string).to include('WARN -- knapsack_pro: warn')
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
describe '.tracker' do
|
|
101
|
-
subject { described_class.tracker }
|
|
102
|
-
|
|
103
|
-
it { should be_a KnapsackPro::Tracker }
|
|
104
|
-
it { expect(subject.object_id).to eql described_class.tracker.object_id }
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
describe '.load_tasks' do
|
|
108
|
-
let(:task_loader) { instance_double(KnapsackPro::TaskLoader) }
|
|
109
|
-
|
|
110
|
-
it do
|
|
111
|
-
expect(KnapsackPro::TaskLoader).to receive(:new).and_return(task_loader)
|
|
112
|
-
expect(task_loader).to receive(:load_tasks)
|
|
113
|
-
described_class.load_tasks
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
require 'rspec/its'
|
|
2
|
-
require 'spinach'
|
|
3
|
-
|
|
4
|
-
require 'timecop'
|
|
5
|
-
Timecop.safe_mode = true
|
|
6
|
-
|
|
7
|
-
require 'vcr'
|
|
8
|
-
require 'webmock/rspec'
|
|
9
|
-
VCR.configure do |config|
|
|
10
|
-
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
|
11
|
-
config.hook_into :webmock # or :fakeweb
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
require 'knapsack_pro'
|
|
15
|
-
|
|
16
|
-
Dir["#{KnapsackPro.root}/spec/{support,fixtures}/**/*.rb"].each { |f| require f }
|
|
17
|
-
|
|
18
|
-
KNAPSACK_PRO_TMP_DIR = File.join(KnapsackPro.root, '.knapsack_pro')
|
|
19
|
-
|
|
20
|
-
RSpec.configure do |config|
|
|
21
|
-
config.order = :random
|
|
22
|
-
config.mock_with :rspec do |mocks|
|
|
23
|
-
mocks.syntax = :expect
|
|
24
|
-
mocks.verify_partial_doubles = true
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
config.expect_with :rspec do |c|
|
|
28
|
-
c.syntax = :expect
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
config.before(:each) do
|
|
32
|
-
if RSpec.current_example.metadata[:clear_tmp]
|
|
33
|
-
FileUtils.rm_r(KNAPSACK_PRO_TMP_DIR) if File.exist?(KNAPSACK_PRO_TMP_DIR)
|
|
34
|
-
FileUtils.mkdir_p(KNAPSACK_PRO_TMP_DIR)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
config.after(:each) do
|
|
39
|
-
if RSpec.current_example.metadata[:clear_tmp]
|
|
40
|
-
FileUtils.rm_r(KNAPSACK_PRO_TMP_DIR) if File.exist?(KNAPSACK_PRO_TMP_DIR)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
config.before(:each) do
|
|
45
|
-
allow_any_instance_of(KnapsackPro::Client::Connection).to receive(:net_http).and_return(Net::HTTP)
|
|
46
|
-
end
|
|
47
|
-
end
|
data/spec/support/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module Cucumber
|
|
2
|
-
# Cucumber 1 and 2
|
|
3
|
-
# https://github.com/cucumber/cucumber-ruby/blob/v2.99.0/lib/cucumber/rb_support/rb_dsl.rb
|
|
4
|
-
module RbSupport
|
|
5
|
-
class RbDsl
|
|
6
|
-
class << self
|
|
7
|
-
def register_rb_hook(phase, tag_names, proc)
|
|
8
|
-
proc.call
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# Cucumber 3
|
|
15
|
-
# https://github.com/cucumber/cucumber-ruby/blob/v3.0.0/lib/cucumber/glue/dsl.rb
|
|
16
|
-
module Glue
|
|
17
|
-
class Dsl
|
|
18
|
-
class << self
|
|
19
|
-
def register_rb_hook(phase, tag_names, proc)
|
|
20
|
-
proc.call
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
class Runnable
|
|
9
|
-
def self.reset; end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
# https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb
|
|
13
|
-
def self.after_run(&block)
|
|
14
|
-
block.call
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def self.run(args); end
|
|
18
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
data/spec_fake/spec_helper.rb
DELETED
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'knapsack_pro'
|
|
2
|
-
require_relative '../lib/knapsack_pro/formatters/time_tracker'
|
|
3
|
-
|
|
4
|
-
class TestableTimeTracker < KnapsackPro::Formatters::TimeTracker
|
|
5
|
-
::RSpec::Core::Formatters.register self, :dump_summary
|
|
6
|
-
|
|
7
|
-
if ENV['TEST__SBTE']
|
|
8
|
-
def rspec_split_by_test_example?(_file)
|
|
9
|
-
true
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
if ENV['TEST__EMPTY_FILE_PATH']
|
|
14
|
-
def file_path_for(_example)
|
|
15
|
-
''
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def dump_summary(_)
|
|
20
|
-
method = ENV['TEST__METHOD']
|
|
21
|
-
result = send(method)
|
|
22
|
-
puts Marshal.dump(result)
|
|
23
|
-
return if ENV['TEST__DEBUG'].nil?
|
|
24
|
-
|
|
25
|
-
warn 'DEBUG'
|
|
26
|
-
warn result
|
|
27
|
-
warn 'GUBED'
|
|
28
|
-
end
|
|
29
|
-
end
|
data/test_fake/a_test.rb
DELETED
|
File without changes
|
data/test_fake/b_test.rb
DELETED
|
File without changes
|