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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
2555bf5e
Commit
2555bf5e
authored
Jul 11, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Log push output on exception"
This reverts commit
d493c91d
.
parent
c74e57bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
qa/qa/specs/features/repository/protected_branches_spec.rb
qa/qa/specs/features/repository/protected_branches_spec.rb
+6
-18
No files found.
qa/qa/specs/features/repository/protected_branches_spec.rb
View file @
2555bf5e
...
...
@@ -13,15 +13,11 @@ module QA
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
end
after
do
|
example
|
after
do
# We need to clear localStorage because we're using it for the dropdown,
# and capybara doesn't do this for us.
# https://github.com/teamcapybara/capybara/issues/1702
Capybara
.
execute_script
'localStorage.clear()'
# In order to help diagnose a false failure
# https://gitlab.com/gitlab-org/gitlab-ce/issues/48241
log_push_output
if
example
.
exception
end
context
'when developers and maintainers are allowed to push to a protected branch'
do
...
...
@@ -31,9 +27,9 @@ module QA
expect
(
protected_branch
.
name
).
to
have_content
(
branch_name
)
expect
(
protected_branch
.
push_allowance
).
to
have_content
(
'Developers + Maintainers'
)
@
push
=
push_new_file
(
branch_name
)
push
=
push_new_file
(
branch_name
)
expect
(
@
push
.
output
).
to
match
(
/remote: To create a merge request for protected-branch, visit/
)
expect
(
push
.
output
).
to
match
(
/remote: To create a merge request for protected-branch, visit/
)
end
end
...
...
@@ -41,11 +37,11 @@ module QA
it
'user without push rights fails to push to the protected branch'
do
create_protected_branch
(
allow_to_push:
false
)
@
push
=
push_new_file
(
branch_name
)
push
=
push_new_file
(
branch_name
)
expect
(
@
push
.
output
)
expect
(
push
.
output
)
.
to
match
(
/remote\: GitLab\: You are not allowed to push code to protected branches on this project/
)
expect
(
@
push
.
output
)
expect
(
push
.
output
)
.
to
match
(
/\[remote rejected\]
#{
branch_name
}
->
#{
branch_name
}
\(pre-receive hook declined\)/
)
end
end
...
...
@@ -69,13 +65,5 @@ module QA
resource
.
new_branch
=
false
end
end
def
log_push_output
if
defined?
(
@push
)
filename
=
File
.
join
(
'tmp'
,
"push-output-
#{
project
.
name
}
"
)
puts
"Exception detected. Push output will be saved to
#{
filename
}
"
IO
.
binwrite
(
filename
,
@push
.
output
)
end
end
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