Commit 0a0f337c authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'qa/rs-suppress-git-output' into 'master'

Suppress git output when running QA as a non-default user

Closes gitlab-qa#157

See merge request gitlab-org/gitlab-ce!17006
parents fa1134ea 8bf5203b
...@@ -33,7 +33,7 @@ module QA ...@@ -33,7 +33,7 @@ module QA
end end
def clone(opts = '') def clone(opts = '')
`git clone #{opts} #{@uri.to_s} ./` `git clone #{opts} #{@uri.to_s} ./ #{suppress_output}`
end end
def shallow_clone def shallow_clone
...@@ -61,12 +61,22 @@ module QA ...@@ -61,12 +61,22 @@ module QA
end end
def push_changes(branch = 'master') def push_changes(branch = 'master')
`git push #{@uri.to_s} #{branch}` `git push #{@uri.to_s} #{branch} #{suppress_output}`
end end
def commits def commits
`git log --oneline`.split("\n") `git log --oneline`.split("\n")
end end
private
def suppress_output
# If we're running as the default user, it's probably a temporary
# instance and output can be useful for debugging
return if @username == Runtime::User.default_name
"&> #{File::NULL}"
end
end end
end end
end end
...@@ -3,8 +3,12 @@ module QA ...@@ -3,8 +3,12 @@ module QA
module User module User
extend self extend self
def default_name
'root'
end
def name def name
Runtime::Env.user_username || 'root' Runtime::Env.user_username || default_name
end end
def password def password
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment