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
b94ab577
Commit
b94ab577
authored
Dec 28, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rescue just the report download part
parent
790ea416
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
13 deletions
+9
-13
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+1
-1
qa/qa/tools/knapsack_report.rb
qa/qa/tools/knapsack_report.rb
+5
-5
qa/spec/runtime/env_spec.rb
qa/spec/runtime/env_spec.rb
+2
-6
qa/spec/scenario/test/integration/github_spec.rb
qa/spec/scenario/test/integration/github_spec.rb
+1
-1
No files found.
qa/qa/runtime/env.rb
View file @
b94ab577
...
...
@@ -281,7 +281,7 @@ module QA
end
def
knapsack?
running_in_ci?
&&
ENV
[
'CI_NODE_TOTAL'
].
to_i
>
1
&&
ENV
[
'NO_KNAPSACK'
]
!=
"true"
ENV
[
'CI_NODE_TOTAL'
].
to_i
>
1
&&
ENV
[
'NO_KNAPSACK'
]
!=
"true"
end
def
ldap_username
...
...
qa/qa/tools/knapsack_report.rb
View file @
b94ab577
...
...
@@ -25,11 +25,6 @@ module QA
Knapsack
.
logger
=
QA
::
Runtime
::
Logger
.
logger
download_report
rescue
StandardError
=>
e
logger
.
warn
(
"Failed to download latest knapsack report:
#{
e
}
"
)
logger
.
warn
(
"Falling back to 'knapsack/master_report.json'"
)
ENV
[
"KNAPSACK_REPORT_PATH"
]
=
"knapsack/master_report.json"
end
# Download knapsack report from gcs bucket
...
...
@@ -39,6 +34,11 @@ module QA
logger
.
debug
(
"Downloading latest knapsack report for '
#{
report_name
}
' to '
#{
report_path
}
'"
)
file
=
client
.
get_object
(
BUCKET
,
report_file
)
File
.
write
(
report_path
,
file
[
:body
])
rescue
StandardError
=>
e
logger
.
warn
(
"Failed to fetch latest knapsack report:
#{
e
}
"
)
logger
.
warn
(
"Falling back to 'knapsack/master_report.json'"
)
ENV
[
"KNAPSACK_REPORT_PATH"
]
=
"knapsack/master_report.json"
end
# Rename and move new regenerated report to a separate folder used to indicate report name
...
...
qa/spec/runtime/env_spec.rb
View file @
b94ab577
...
...
@@ -170,13 +170,10 @@ RSpec.describe QA::Runtime::Env do
describe
'.knapsack?'
do
before
do
stub_env
(
'CI'
,
'true'
)
stub_env
(
'CI_NODE_TOTAL'
,
'2'
)
end
it
'returns true if running in parallel CI run'
do
stub_env
(
'KNAPSACK_GENERATE_REPORT'
,
'true'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
...
...
@@ -185,15 +182,14 @@ RSpec.describe QA::Runtime::Env do
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
it
'returns false if not running in parallel job'
do
it
'returns false if not running in
a
parallel job'
do
stub_env
(
'CI_NODE_TOTAL'
,
'1'
)
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
it
'returns false if not running in ci'
do
stub_env
(
'CI'
,
nil
)
stub_env
(
'CI_SERVER'
,
nil
)
stub_env
(
'CI_NODE_TOTAL'
,
nil
)
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
...
...
qa/spec/scenario/test/integration/github_spec.rb
View file @
b94ab577
...
...
@@ -2,7 +2,7 @@
RSpec
.
describe
QA
::
Scenario
::
Test
::
Integration
::
Github
do
describe
'#perform'
do
let
(
:env
)
{
spy
(
'Runtime::Env'
)
}
let
(
:env
)
{
spy
(
'Runtime::Env'
,
knapsack?:
false
)
}
before
do
stub_const
(
'QA::Runtime::Env'
,
env
)
...
...
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