summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-08-22 14:33:33 -0700
committerStan Hu <stanhu@gmail.com>2018-08-22 14:38:12 -0700
commitbc7a4eedf9fa6681465b622af52c34d49ffb5d0e (patch)
tree6955d807ce63b8b839654947c0be4b4faa66c1c4
parent0e9dc23d4622332c3f8874ba024cac9aa28277a3 (diff)
downloadgitlab-ce-bc7a4eedf9fa6681465b622af52c34d49ffb5d0e.tar.gz
Add support for testing Git over HTTP with LDAP users
This would have helped catch https://gitlab.com/gitlab-org/gitlab-ce/issues/50579.
-rw-r--r--qa/qa/git/repository.rb9
-rw-r--r--qa/qa/specs/features/repository/clone_spec.rb2
-rw-r--r--qa/qa/specs/features/repository/protected_branches_spec.rb2
-rw-r--r--qa/qa/specs/features/repository/push_spec.rb2
4 files changed, 10 insertions, 5 deletions
diff --git a/qa/qa/git/repository.rb b/qa/qa/git/repository.rb
index bdbb18b5045..faecacd45ec 100644
--- a/qa/qa/git/repository.rb
+++ b/qa/qa/git/repository.rb
@@ -28,8 +28,13 @@ module QA
end
def use_default_credentials
- self.username = Runtime::User.username
- self.password = Runtime::User.password
+ if ::QA::Runtime::User.ldap_user?
+ self.username = Runtime::User.ldap_username
+ self.password = Runtime::User.ldap_password
+ else
+ self.username = Runtime::User.username
+ self.password = Runtime::User.password
+ end
end
def clone(opts = '')
diff --git a/qa/qa/specs/features/repository/clone_spec.rb b/qa/qa/specs/features/repository/clone_spec.rb
index 8b0613c5f78..70881f0f8d1 100644
--- a/qa/qa/specs/features/repository/clone_spec.rb
+++ b/qa/qa/specs/features/repository/clone_spec.rb
@@ -1,5 +1,5 @@
module QA
- describe 'clone code from the repository' do
+ describe 'clone code from the repository', :ldap do
context 'with regular account over http' do
let(:location) do
Page::Project::Show.act do
diff --git a/qa/qa/specs/features/repository/protected_branches_spec.rb b/qa/qa/specs/features/repository/protected_branches_spec.rb
index aa23145478d..5ae01a12425 100644
--- a/qa/qa/specs/features/repository/protected_branches_spec.rb
+++ b/qa/qa/specs/features/repository/protected_branches_spec.rb
@@ -1,5 +1,5 @@
module QA
- describe 'branch protection support' do
+ describe 'branch protection support', :ldap do
let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' }
let(:project) do
diff --git a/qa/qa/specs/features/repository/push_spec.rb b/qa/qa/specs/features/repository/push_spec.rb
index 1e89942e932..99d4c16c7c7 100644
--- a/qa/qa/specs/features/repository/push_spec.rb
+++ b/qa/qa/specs/features/repository/push_spec.rb
@@ -1,5 +1,5 @@
module QA
- describe 'push code to repository' do
+ describe 'push code to repository', :ldap do
context 'with regular account over http' do
it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)