BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
06165fa0
Commit
06165fa0
authored
Aug 03, 2017
by
Jacob Vosmaer (GitLab)
Committed by
Rémy Coutable
Aug 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test gitaly when older than version file
parent
beaa0723
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
gitaly-test-build
scripts/gitaly-test-build
+10
-1
test_env.rb
spec/support/test_env.rb
+11
-0
No files found.
scripts/gitaly-test-build
View file @
06165fa0
#!/usr/bin/env ruby
#!/usr/bin/env ruby
require
'fileutils'
# This script assumes tmp/tests/gitaly already contains the correct
# This script assumes tmp/tests/gitaly already contains the correct
# Gitaly version. We just have to compile it and run its 'bundle
# Gitaly version. We just have to compile it and run its 'bundle
# install'. We have this separate script for that because weird things
# install'. We have this separate script for that because weird things
...
@@ -7,4 +9,11 @@
...
@@ -7,4 +9,11 @@
# called 'bundle install' using a different Gemfile, as happens with
# called 'bundle install' using a different Gemfile, as happens with
# gitlab-ce and gitaly.
# gitlab-ce and gitaly.
abort
'gitaly build failed'
unless
system
(
'make'
,
chdir:
'tmp/tests/gitaly'
)
dir
=
'tmp/tests/gitaly'
abort
'gitaly build failed'
unless
system
(
'make'
,
chdir:
dir
)
# Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'.
# Without this a gitaly executable created in the setup-test-env job
# will look stale compared to GITALY_SERVER_VERSION.
FileUtils
.
touch
(
File
.
join
(
dir
,
'gitaly'
),
mtime:
Time
.
now
+
(
1
<<
24
))
spec/support/test_env.rb
View file @
06165fa0
...
@@ -133,6 +133,12 @@ module TestEnv
...
@@ -133,6 +133,12 @@ module TestEnv
def
setup_gitaly
def
setup_gitaly
socket_path
=
Gitlab
::
GitalyClient
.
address
(
'default'
).
sub
(
/\Aunix:/
,
''
)
socket_path
=
Gitlab
::
GitalyClient
.
address
(
'default'
).
sub
(
/\Aunix:/
,
''
)
gitaly_dir
=
File
.
dirname
(
socket_path
)
gitaly_dir
=
File
.
dirname
(
socket_path
)
if
gitaly_dir_stale?
(
gitaly_dir
)
puts
"rm -rf
#{
gitaly_dir
}
"
FileUtils
.
rm_rf
(
gitaly_dir
)
end
gitaly_needs_update
=
component_needs_update?
(
gitaly_dir
,
gitaly_needs_update
=
component_needs_update?
(
gitaly_dir
,
Gitlab
::
GitalyClient
.
expected_server_version
)
Gitlab
::
GitalyClient
.
expected_server_version
)
...
@@ -143,6 +149,11 @@ module TestEnv
...
@@ -143,6 +149,11 @@ module TestEnv
start_gitaly
(
gitaly_dir
)
start_gitaly
(
gitaly_dir
)
end
end
def
gitaly_dir_stale?
(
dir
)
gitaly_executable
=
File
.
join
(
dir
,
'gitaly'
)
!
File
.
exist?
(
gitaly_executable
)
||
(
File
.
mtime
(
gitaly_executable
)
<
File
.
mtime
(
Rails
.
root
.
join
(
'GITALY_SERVER_VERSION'
)))
end
def
start_gitaly
(
gitaly_dir
)
def
start_gitaly
(
gitaly_dir
)
if
ENV
[
'CI'
].
present?
if
ENV
[
'CI'
].
present?
# Gitaly has been spawned outside this process already
# Gitaly has been spawned outside this process already
...
...
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