Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
674cf873
Commit
674cf873
authored
Dec 14, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Do not bind knapsack unless parallel run
parent
4727b151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
19 deletions
+8
-19
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+2
-0
qa/spec/runtime/env_spec.rb
qa/spec/runtime/env_spec.rb
+6
-19
No files found.
qa/qa/runtime/env.rb
View file @
674cf873
...
...
@@ -281,6 +281,8 @@ module QA
end
def
knapsack?
return
false
unless
ENV
[
'CI_NODE_TOTAL'
].
to_i
>
1
!!
(
ENV
[
'KNAPSACK_GENERATE_REPORT'
]
||
ENV
[
'KNAPSACK_REPORT_PATH'
]
||
ENV
[
'KNAPSACK_TEST_FILE_PATTERN'
])
end
...
...
qa/spec/runtime/env_spec.rb
View file @
674cf873
...
...
@@ -169,6 +169,10 @@ RSpec.describe QA::Runtime::Env do
end
describe
'.knapsack?'
do
before
do
stub_env
(
'CI_NODE_TOTAL'
,
'2'
)
end
it
'returns true if KNAPSACK_GENERATE_REPORT is defined'
do
stub_env
(
'KNAPSACK_GENERATE_REPORT'
,
'true'
)
...
...
@@ -190,28 +194,11 @@ RSpec.describe QA::Runtime::Env do
it
'returns false if neither KNAPSACK_GENERATE_REPORT nor KNAPSACK_REPORT_PATH nor KNAPSACK_TEST_FILE_PATTERN are defined'
do
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
end
describe
'.knapsack?
'
do
it
'returns true if KNAPSACK_GENERATE_REPORT is defined'
do
it
'returns false if not running in parallel job
'
do
stub_env
(
'CI_NODE_TOTAL'
,
'1'
)
stub_env
(
'KNAPSACK_GENERATE_REPORT'
,
'true'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns true if KNAPSACK_REPORT_PATH is defined'
do
stub_env
(
'KNAPSACK_REPORT_PATH'
,
'/a/path'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns true if KNAPSACK_TEST_FILE_PATTERN is defined'
do
stub_env
(
'KNAPSACK_TEST_FILE_PATTERN'
,
'/a/**/pattern'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns false if neither KNAPSACK_GENERATE_REPORT nor KNAPSACK_REPORT_PATH nor KNAPSACK_TEST_FILE_PATTERN are defined'
do
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment