From bc7a4eedf9fa6681465b622af52c34d49ffb5d0e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 22 Aug 2018 14:33:33 -0700 Subject: Add support for testing Git over HTTP with LDAP users This would have helped catch https://gitlab.com/gitlab-org/gitlab-ce/issues/50579. --- qa/qa/git/repository.rb | 9 +++++++-- qa/qa/specs/features/repository/clone_spec.rb | 2 +- qa/qa/specs/features/repository/protected_branches_spec.rb | 2 +- qa/qa/specs/features/repository/push_spec.rb | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'qa') 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) -- cgit v1.2.1