knapsack_pro 0.55.1 → 0.55.2
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/CHANGELOG.md +8 -0
- data/README.md +4 -1
- data/lib/knapsack_pro/runners/queue/minitest_runner.rb +34 -4
- data/lib/knapsack_pro/runners/queue/rspec_runner.rb +34 -4
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/runners/queue/minitest_runner_spec.rb +66 -23
- data/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb +105 -31
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 659ee8cc41fe02f9756a80b1df0611052ef20132cb64afc909d050c3c438e5f0
|
4
|
+
data.tar.gz: 9c5f97c7a0606a936512542aea04d84aa21e23806215cdbba0445651eef354e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48213d6111290298b56a7ada4621144279dc6b6e5e435e244c6a65a3f159b5e34297183803341b009a86c09acbe4827e8c9879a87e25f9a494fb5fb5af6d43d
|
7
|
+
data.tar.gz: aef93bd34c521290ec5096754b4cd1b531a9e5da828d48237b78d635e1771c63604b4dad88b5808808059fac9da407cddb679e76f219c4359483a1558b6f53e0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
* TODO
|
4
4
|
|
5
|
+
### 0.55.2
|
6
|
+
|
7
|
+
* Remove recursion in Queue Mode
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/64
|
10
|
+
|
11
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.55.1...v0.55.2
|
12
|
+
|
5
13
|
### 0.55.1
|
6
14
|
|
7
15
|
* Switch to fallback mode when failed to open TCP connection to API
|
data/README.md
CHANGED
@@ -215,7 +215,7 @@ end
|
|
215
215
|
|
216
216
|
# add below when you hook into webmock
|
217
217
|
require 'webmock/rspec'
|
218
|
-
WebMock.disable_net_connect!(:
|
218
|
+
WebMock.disable_net_connect!(allow: ['api.knapsackpro.com'])
|
219
219
|
|
220
220
|
# add below when you use FakeWeb
|
221
221
|
require 'fakeweb'
|
@@ -745,6 +745,7 @@ Here you can read how to configure [junit formatter](#how-to-use-junit-formatter
|
|
745
745
|
# spec_helper.rb or rails_helper.rb
|
746
746
|
|
747
747
|
# TODO This must be the same path as value for rspec --out argument
|
748
|
+
# Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.xml may not work. Please use full path instead.
|
748
749
|
TMP_RSPEC_XML_REPORT = 'tmp/rspec.xml'
|
749
750
|
# move results to FINAL_RSPEC_XML_REPORT so the results won't accumulate with duplicated xml tags in TMP_RSPEC_XML_REPORT
|
750
751
|
FINAL_RSPEC_XML_REPORT = 'tmp/rspec_final_results.xml'
|
@@ -1444,6 +1445,7 @@ The xml report will contain all tests executed across intermediate test subset r
|
|
1444
1445
|
# spec_helper.rb or rails_helper.rb
|
1445
1446
|
|
1446
1447
|
# TODO This must be the same path as value for rspec --out argument
|
1448
|
+
# Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.xml may not work. Please use full path instead.
|
1447
1449
|
TMP_RSPEC_XML_REPORT = 'tmp/rspec.xml'
|
1448
1450
|
# move results to FINAL_RSPEC_XML_REPORT so the results won't accumulate with duplicated xml tags in TMP_RSPEC_XML_REPORT
|
1449
1451
|
FINAL_RSPEC_XML_REPORT = 'tmp/rspec_final_results.xml'
|
@@ -1472,6 +1474,7 @@ In below code we use CI node index number in `TMP_RSPEC_XML_REPORT` and `FINAL_R
|
|
1472
1474
|
# spec_helper.rb or rails_helper.rb
|
1473
1475
|
|
1474
1476
|
# TODO This must be the same path as value for rspec --out argument
|
1477
|
+
# Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.xml may not work. Please use full path instead.
|
1475
1478
|
TMP_RSPEC_XML_REPORT = "tmp/rspec_#{ENV['KNAPSACK_PRO_CI_NODE_INDEX']}.xml"
|
1476
1479
|
# move results to FINAL_RSPEC_XML_REPORT so the results won't accumulate with duplicated xml tags in TMP_RSPEC_XML_REPORT
|
1477
1480
|
FINAL_RSPEC_XML_REPORT = "tmp/rspec_final_results_#{ENV['KNAPSACK_PRO_CI_NODE_INDEX']}.xml"
|
@@ -17,10 +17,29 @@ module KnapsackPro
|
|
17
17
|
$LOAD_PATH.unshift(runner.test_dir)
|
18
18
|
|
19
19
|
cli_args = (args || '').split
|
20
|
-
|
20
|
+
|
21
|
+
accumulator = {
|
22
|
+
status: :next,
|
23
|
+
runner: runner,
|
24
|
+
can_initialize_queue: true,
|
25
|
+
args: cli_args,
|
26
|
+
exitstatus: 0,
|
27
|
+
all_test_file_paths: [],
|
28
|
+
}
|
29
|
+
while accumulator[:status] == :next
|
30
|
+
accumulator = run_tests(accumulator)
|
31
|
+
end
|
32
|
+
|
33
|
+
Kernel.exit(accumulator[:exitstatus])
|
21
34
|
end
|
22
35
|
|
23
|
-
def self.run_tests(
|
36
|
+
def self.run_tests(accumulator)
|
37
|
+
runner = accumulator.fetch(:runner)
|
38
|
+
can_initialize_queue = accumulator.fetch(:can_initialize_queue)
|
39
|
+
args = accumulator.fetch(:args)
|
40
|
+
exitstatus = accumulator.fetch(:exitstatus)
|
41
|
+
all_test_file_paths = accumulator.fetch(:all_test_file_paths)
|
42
|
+
|
24
43
|
test_file_paths = runner.test_file_paths(
|
25
44
|
can_initialize_queue: can_initialize_queue,
|
26
45
|
executed_test_files: all_test_file_paths
|
@@ -30,7 +49,11 @@ module KnapsackPro
|
|
30
49
|
KnapsackPro::Hooks::Queue.call_after_queue
|
31
50
|
|
32
51
|
KnapsackPro::Report.save_node_queue_to_api
|
33
|
-
|
52
|
+
|
53
|
+
return {
|
54
|
+
status: :completed,
|
55
|
+
exitstatus: exitstatus,
|
56
|
+
}
|
34
57
|
else
|
35
58
|
subset_queue_id = KnapsackPro::Config::EnvGenerator.set_subset_queue_id
|
36
59
|
ENV['KNAPSACK_PRO_SUBSET_QUEUE_ID'] = subset_queue_id
|
@@ -46,7 +69,14 @@ module KnapsackPro
|
|
46
69
|
|
47
70
|
KnapsackPro::Report.save_subset_queue_to_file
|
48
71
|
|
49
|
-
|
72
|
+
return {
|
73
|
+
status: :next,
|
74
|
+
runner: runner,
|
75
|
+
can_initialize_queue: false,
|
76
|
+
args: args,
|
77
|
+
exitstatus: exitstatus,
|
78
|
+
all_test_file_paths: all_test_file_paths,
|
79
|
+
}
|
50
80
|
end
|
51
81
|
end
|
52
82
|
|
@@ -21,10 +21,29 @@ module KnapsackPro
|
|
21
21
|
'--format', KnapsackPro::Formatters::RSpecQueueSummaryFormatter.to_s,
|
22
22
|
'--default-path', runner.test_dir,
|
23
23
|
]
|
24
|
-
|
24
|
+
|
25
|
+
accumulator = {
|
26
|
+
status: :next,
|
27
|
+
runner: runner,
|
28
|
+
can_initialize_queue: true,
|
29
|
+
args: cli_args,
|
30
|
+
exitstatus: 0,
|
31
|
+
all_test_file_paths: [],
|
32
|
+
}
|
33
|
+
while accumulator[:status] == :next
|
34
|
+
accumulator = run_tests(accumulator)
|
35
|
+
end
|
36
|
+
|
37
|
+
Kernel.exit(accumulator[:exitstatus])
|
25
38
|
end
|
26
39
|
|
27
|
-
def self.run_tests(
|
40
|
+
def self.run_tests(accumulator)
|
41
|
+
runner = accumulator.fetch(:runner)
|
42
|
+
can_initialize_queue = accumulator.fetch(:can_initialize_queue)
|
43
|
+
args = accumulator.fetch(:args)
|
44
|
+
exitstatus = accumulator.fetch(:exitstatus)
|
45
|
+
all_test_file_paths = accumulator.fetch(:all_test_file_paths)
|
46
|
+
|
28
47
|
test_file_paths = runner.test_file_paths(
|
29
48
|
can_initialize_queue: can_initialize_queue,
|
30
49
|
executed_test_files: all_test_file_paths
|
@@ -41,7 +60,11 @@ module KnapsackPro
|
|
41
60
|
KnapsackPro::Hooks::Queue.call_after_queue
|
42
61
|
|
43
62
|
KnapsackPro::Report.save_node_queue_to_api
|
44
|
-
|
63
|
+
|
64
|
+
return {
|
65
|
+
status: :completed,
|
66
|
+
exitstatus: exitstatus,
|
67
|
+
}
|
45
68
|
else
|
46
69
|
subset_queue_id = KnapsackPro::Config::EnvGenerator.set_subset_queue_id
|
47
70
|
ENV['KNAPSACK_PRO_SUBSET_QUEUE_ID'] = subset_queue_id
|
@@ -59,7 +82,14 @@ module KnapsackPro
|
|
59
82
|
|
60
83
|
KnapsackPro::Hooks::Queue.call_after_subset_queue
|
61
84
|
|
62
|
-
|
85
|
+
return {
|
86
|
+
status: :next,
|
87
|
+
runner: runner,
|
88
|
+
can_initialize_queue: false,
|
89
|
+
args: args,
|
90
|
+
exitstatus: exitstatus,
|
91
|
+
all_test_file_paths: all_test_file_paths,
|
92
|
+
}
|
63
93
|
end
|
64
94
|
end
|
65
95
|
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -28,10 +28,24 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
28
28
|
let(:args) { '--verbose --pride' }
|
29
29
|
|
30
30
|
it do
|
31
|
-
|
32
|
-
|
31
|
+
expected_exitstatus = 0
|
32
|
+
expected_accumulator = {
|
33
|
+
status: :completed,
|
34
|
+
exitstatus: expected_exitstatus
|
35
|
+
}
|
36
|
+
accumulator = {
|
37
|
+
status: :next,
|
38
|
+
runner: runner,
|
39
|
+
can_initialize_queue: true,
|
40
|
+
args: ['--verbose', '--pride'],
|
41
|
+
exitstatus: 0,
|
42
|
+
all_test_file_paths: [],
|
43
|
+
}
|
44
|
+
expect(described_class).to receive(:run_tests).with(accumulator).and_return(expected_accumulator)
|
45
|
+
|
46
|
+
expect(Kernel).to receive(:exit).with(expected_exitstatus)
|
33
47
|
|
34
|
-
|
48
|
+
subject
|
35
49
|
end
|
36
50
|
end
|
37
51
|
|
@@ -39,10 +53,24 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
39
53
|
let(:args) { nil }
|
40
54
|
|
41
55
|
it do
|
42
|
-
|
43
|
-
|
56
|
+
expected_exitstatus = 0
|
57
|
+
expected_accumulator = {
|
58
|
+
status: :completed,
|
59
|
+
exitstatus: expected_exitstatus
|
60
|
+
}
|
61
|
+
accumulator = {
|
62
|
+
status: :next,
|
63
|
+
runner: runner,
|
64
|
+
can_initialize_queue: true,
|
65
|
+
args: [],
|
66
|
+
exitstatus: 0,
|
67
|
+
all_test_file_paths: [],
|
68
|
+
}
|
69
|
+
expect(described_class).to receive(:run_tests).with(accumulator).and_return(expected_accumulator)
|
70
|
+
|
71
|
+
expect(Kernel).to receive(:exit).with(expected_exitstatus)
|
44
72
|
|
45
|
-
|
73
|
+
subject
|
46
74
|
end
|
47
75
|
end
|
48
76
|
end
|
@@ -52,11 +80,21 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
52
80
|
let(:can_initialize_queue) { double(:can_initialize_queue) }
|
53
81
|
let(:args) { ['--verbose', '--pride'] }
|
54
82
|
let(:exitstatus) { 0 }
|
83
|
+
let(:all_test_file_paths) { [] }
|
84
|
+
let(:accumulator) do
|
85
|
+
{
|
86
|
+
runner: runner,
|
87
|
+
can_initialize_queue: can_initialize_queue,
|
88
|
+
args: args,
|
89
|
+
exitstatus: exitstatus,
|
90
|
+
all_test_file_paths: all_test_file_paths,
|
91
|
+
}
|
92
|
+
end
|
55
93
|
|
56
|
-
subject { described_class.run_tests(
|
94
|
+
subject { described_class.run_tests(accumulator) }
|
57
95
|
|
58
96
|
before do
|
59
|
-
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: can_initialize_queue, executed_test_files:
|
97
|
+
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: can_initialize_queue, executed_test_files: all_test_file_paths).and_return(test_file_paths)
|
60
98
|
end
|
61
99
|
|
62
100
|
context 'when test files exist' do
|
@@ -82,20 +120,20 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
82
120
|
expect(KnapsackPro::Hooks::Queue).to receive(:call_after_subset_queue)
|
83
121
|
|
84
122
|
expect(KnapsackPro::Report).to receive(:save_subset_queue_to_file)
|
85
|
-
|
86
|
-
# second call of run_tests because of recursion
|
87
|
-
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: false, executed_test_files: ['a_test.rb', 'b_test.rb']).and_return([])
|
88
123
|
end
|
89
124
|
|
90
125
|
context 'when tests are passing' do
|
91
126
|
let(:is_tests_green) { true }
|
92
127
|
|
93
128
|
it 'returns exit code 0' do
|
94
|
-
expect(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
129
|
+
expect(subject).to eq({
|
130
|
+
status: :next,
|
131
|
+
runner: runner,
|
132
|
+
can_initialize_queue: false,
|
133
|
+
args: args,
|
134
|
+
exitstatus: exitstatus,
|
135
|
+
all_test_file_paths: test_file_paths,
|
136
|
+
})
|
99
137
|
end
|
100
138
|
end
|
101
139
|
|
@@ -103,11 +141,14 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
103
141
|
let(:is_tests_green) { false }
|
104
142
|
|
105
143
|
it 'returns exit code 1' do
|
106
|
-
expect(
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
144
|
+
expect(subject).to eq({
|
145
|
+
status: :next,
|
146
|
+
runner: runner,
|
147
|
+
can_initialize_queue: false,
|
148
|
+
args: args,
|
149
|
+
exitstatus: 1, # tests failed
|
150
|
+
all_test_file_paths: test_file_paths,
|
151
|
+
})
|
111
152
|
end
|
112
153
|
end
|
113
154
|
end
|
@@ -118,9 +159,11 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
|
|
118
159
|
it 'returns exit code 0' do
|
119
160
|
expect(KnapsackPro::Hooks::Queue).to receive(:call_after_queue)
|
120
161
|
expect(KnapsackPro::Report).to receive(:save_node_queue_to_api)
|
121
|
-
expect(described_class).to receive(:exit).with(0)
|
122
162
|
|
123
|
-
subject
|
163
|
+
expect(subject).to eq({
|
164
|
+
status: :completed,
|
165
|
+
exitstatus: exitstatus,
|
166
|
+
})
|
124
167
|
end
|
125
168
|
end
|
126
169
|
end
|
@@ -34,10 +34,24 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
34
34
|
let(:args) { '--example-arg example-value' }
|
35
35
|
|
36
36
|
it 'uses default formatter progress' do
|
37
|
-
|
38
|
-
|
37
|
+
expected_exitstatus = 0
|
38
|
+
expected_accumulator = {
|
39
|
+
status: :completed,
|
40
|
+
exitstatus: expected_exitstatus
|
41
|
+
}
|
42
|
+
accumulator = {
|
43
|
+
status: :next,
|
44
|
+
runner: runner,
|
45
|
+
can_initialize_queue: true,
|
46
|
+
args: ['--example-arg', 'example-value', '--format', 'progress', '--format', 'KnapsackPro::Formatters::RSpecQueueSummaryFormatter', '--default-path', 'fake-test-dir'],
|
47
|
+
exitstatus: 0,
|
48
|
+
all_test_file_paths: [],
|
49
|
+
}
|
50
|
+
expect(described_class).to receive(:run_tests).with(accumulator).and_return(expected_accumulator)
|
51
|
+
|
52
|
+
expect(Kernel).to receive(:exit).with(expected_exitstatus)
|
39
53
|
|
40
|
-
|
54
|
+
subject
|
41
55
|
end
|
42
56
|
end
|
43
57
|
|
@@ -45,10 +59,24 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
45
59
|
let(:args) { '--format documentation' }
|
46
60
|
|
47
61
|
it 'uses provided format param instead of default formatter progress' do
|
48
|
-
|
49
|
-
|
62
|
+
expected_exitstatus = 0
|
63
|
+
expected_accumulator = {
|
64
|
+
status: :completed,
|
65
|
+
exitstatus: expected_exitstatus
|
66
|
+
}
|
67
|
+
accumulator = {
|
68
|
+
status: :next,
|
69
|
+
runner: runner,
|
70
|
+
can_initialize_queue: true,
|
71
|
+
args: ['--format', 'documentation', '--format', 'KnapsackPro::Formatters::RSpecQueueSummaryFormatter', '--default-path', 'fake-test-dir'],
|
72
|
+
exitstatus: 0,
|
73
|
+
all_test_file_paths: [],
|
74
|
+
}
|
75
|
+
expect(described_class).to receive(:run_tests).with(accumulator).and_return(expected_accumulator)
|
76
|
+
|
77
|
+
expect(Kernel).to receive(:exit).with(expected_exitstatus)
|
50
78
|
|
51
|
-
|
79
|
+
subject
|
52
80
|
end
|
53
81
|
end
|
54
82
|
end
|
@@ -57,10 +85,24 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
57
85
|
let(:args) { nil }
|
58
86
|
|
59
87
|
it do
|
60
|
-
|
61
|
-
|
88
|
+
expected_exitstatus = 0
|
89
|
+
expected_accumulator = {
|
90
|
+
status: :completed,
|
91
|
+
exitstatus: expected_exitstatus
|
92
|
+
}
|
93
|
+
accumulator = {
|
94
|
+
status: :next,
|
95
|
+
runner: runner,
|
96
|
+
can_initialize_queue: true,
|
97
|
+
args: ['--format', 'progress', '--format', 'KnapsackPro::Formatters::RSpecQueueSummaryFormatter', '--default-path', 'fake-test-dir'],
|
98
|
+
exitstatus: 0,
|
99
|
+
all_test_file_paths: [],
|
100
|
+
}
|
101
|
+
expect(described_class).to receive(:run_tests).with(accumulator).and_return(expected_accumulator)
|
102
|
+
|
103
|
+
expect(Kernel).to receive(:exit).with(expected_exitstatus)
|
62
104
|
|
63
|
-
|
105
|
+
subject
|
64
106
|
end
|
65
107
|
end
|
66
108
|
end
|
@@ -70,11 +112,21 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
70
112
|
let(:can_initialize_queue) { double(:can_initialize_queue) }
|
71
113
|
let(:args) { ['--example-arg', 'example-value', '--default-path', 'fake-test-dir'] }
|
72
114
|
let(:exitstatus) { double }
|
115
|
+
let(:all_test_file_paths) { [] }
|
116
|
+
let(:accumulator) do
|
117
|
+
{
|
118
|
+
runner: runner,
|
119
|
+
can_initialize_queue: can_initialize_queue,
|
120
|
+
args: args,
|
121
|
+
exitstatus: exitstatus,
|
122
|
+
all_test_file_paths: all_test_file_paths,
|
123
|
+
}
|
124
|
+
end
|
73
125
|
|
74
|
-
subject { described_class.run_tests(
|
126
|
+
subject { described_class.run_tests(accumulator) }
|
75
127
|
|
76
128
|
before do
|
77
|
-
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: can_initialize_queue, executed_test_files:
|
129
|
+
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: can_initialize_queue, executed_test_files: all_test_file_paths).and_return(test_file_paths)
|
78
130
|
end
|
79
131
|
|
80
132
|
context 'when test files exist' do
|
@@ -100,49 +152,71 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
100
152
|
expect(described_class).to receive(:rspec_clear_examples)
|
101
153
|
|
102
154
|
expect(KnapsackPro::Hooks::Queue).to receive(:call_after_subset_queue)
|
103
|
-
|
104
|
-
# second call of run_tests because of recursion
|
105
|
-
expect(runner).to receive(:test_file_paths).with(can_initialize_queue: false, executed_test_files: ['a_spec.rb', 'b_spec.rb']).and_return([])
|
106
155
|
end
|
107
156
|
|
108
157
|
context 'when exit code is zero' do
|
109
158
|
let(:exit_code) { 0 }
|
110
159
|
|
111
160
|
it do
|
112
|
-
expect(
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
161
|
+
expect(subject).to eq({
|
162
|
+
status: :next,
|
163
|
+
runner: runner,
|
164
|
+
can_initialize_queue: false,
|
165
|
+
args: args,
|
166
|
+
exitstatus: exitstatus,
|
167
|
+
all_test_file_paths: test_file_paths,
|
168
|
+
})
|
119
169
|
end
|
120
170
|
end
|
121
171
|
|
122
172
|
context 'when exit code is not zero' do
|
123
173
|
let(:exit_code) { double }
|
124
174
|
|
175
|
+
it do
|
176
|
+
expect(subject).to eq({
|
177
|
+
status: :next,
|
178
|
+
runner: runner,
|
179
|
+
can_initialize_queue: false,
|
180
|
+
args: args,
|
181
|
+
exitstatus: exit_code,
|
182
|
+
all_test_file_paths: test_file_paths,
|
183
|
+
})
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
context "when test files don't exist" do
|
189
|
+
let(:test_file_paths) { [] }
|
190
|
+
|
191
|
+
context 'when all_test_file_paths exist' do
|
192
|
+
let(:all_test_file_paths) { ['a_spec.rb'] }
|
193
|
+
|
125
194
|
it do
|
126
195
|
expect(KnapsackPro::Formatters::RSpecQueueSummaryFormatter).to receive(:print_summary)
|
127
196
|
expect(KnapsackPro::Formatters::RSpecQueueProfileFormatterExtension).to receive(:print_summary)
|
197
|
+
|
128
198
|
expect(KnapsackPro::Hooks::Queue).to receive(:call_after_queue)
|
129
199
|
expect(KnapsackPro::Report).to receive(:save_node_queue_to_api)
|
130
|
-
expect(described_class).to receive(:exit).with(exit_code)
|
131
200
|
|
132
|
-
subject
|
201
|
+
expect(subject).to eq({
|
202
|
+
status: :completed,
|
203
|
+
exitstatus: exitstatus,
|
204
|
+
})
|
133
205
|
end
|
134
206
|
end
|
135
|
-
end
|
136
207
|
|
137
|
-
|
138
|
-
|
208
|
+
context "when all_test_file_paths don't exist" do
|
209
|
+
let(:all_test_file_paths) { [] }
|
139
210
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
expect(described_class).to receive(:exit).with(exitstatus)
|
211
|
+
it do
|
212
|
+
expect(KnapsackPro::Hooks::Queue).to receive(:call_after_queue)
|
213
|
+
expect(KnapsackPro::Report).to receive(:save_node_queue_to_api)
|
144
214
|
|
145
|
-
|
215
|
+
expect(subject).to eq({
|
216
|
+
status: :completed,
|
217
|
+
exitstatus: exitstatus,
|
218
|
+
})
|
219
|
+
end
|
146
220
|
end
|
147
221
|
end
|
148
222
|
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: 0.55.
|
4
|
+
version: 0.55.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|