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
4d03a5f1
Commit
4d03a5f1
authored
Dec 11, 2020
by
Jacob Vosmaer
Committed by
Rémy Coutable
Dec 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test setup: skip workhorse compile if unchanged
parent
11f71707
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/support/helpers/test_env.rb
spec/support/helpers/test_env.rb
+24
-0
No files found.
spec/support/helpers/test_env.rb
View file @
4d03a5f1
...
...
@@ -242,15 +242,39 @@ module TestEnv
def
setup_workhorse
start
=
Time
.
now
return
if
skip_compile_workhorse?
puts
"
\n
==> Setting up GitLab Workhorse..."
FileUtils
.
rm_rf
(
workhorse_dir
)
Gitlab
::
SetupHelper
::
Workhorse
.
compile_into
(
workhorse_dir
)
Gitlab
::
SetupHelper
::
Workhorse
.
create_configuration
(
workhorse_dir
,
nil
)
File
.
write
(
workhorse_tree_file
,
workhorse_tree
)
if
workhorse_source_clean?
puts
" GitLab Workhorse set up in
#{
Time
.
now
-
start
}
seconds...
\n
"
end
def
skip_compile_workhorse?
File
.
directory?
(
workhorse_dir
)
&&
workhorse_source_clean?
&&
File
.
exist?
(
workhorse_tree_file
)
&&
workhorse_tree
==
File
.
read
(
workhorse_tree_file
)
end
def
workhorse_source_clean?
out
=
IO
.
popen
(
%w[git status --porcelain workhorse]
,
&
:read
)
$?
.
success?
&&
out
.
empty?
end
def
workhorse_tree
IO
.
popen
(
%w[git rev-parse HEAD:workhorse]
,
&
:read
)
end
def
workhorse_tree_file
File
.
join
(
workhorse_dir
,
'WORKHORSE_TREE'
)
end
def
workhorse_dir
@workhorse_path
||=
File
.
join
(
'tmp'
,
'tests'
,
'gitlab-workhorse'
)
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