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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
44dc8051
Commit
44dc8051
authored
Mar 25, 2020
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GitHub OAuth e2e spec
Also remove the related scenario and supporting code
parent
550d687c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1 addition
and
176 deletions
+1
-176
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+1
-2
qa/qa.rb
qa/qa.rb
+0
-12
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+0
-6
qa/qa/scenario/test/integration/oauth.rb
qa/qa/scenario/test/integration/oauth.rb
+0
-13
qa/qa/specs/features/browser_ui/1_manage/login/login_via_oauth_spec.rb
...eatures/browser_ui/1_manage/login/login_via_oauth_spec.rb
+0
-19
qa/qa/vendor/github/page/base.rb
qa/qa/vendor/github/page/base.rb
+0
-14
qa/qa/vendor/github/page/login.rb
qa/qa/vendor/github/page/login.rb
+0
-38
qa/qa/vendor/one_password/cli.rb
qa/qa/vendor/one_password/cli.rb
+0
-63
qa/qa/vendor/one_password/darwin/op
qa/qa/vendor/one_password/darwin/op
+0
-0
qa/qa/vendor/one_password/linux/op
qa/qa/vendor/one_password/linux/op
+0
-0
qa/spec/scenario/test/integration/oauth_spec.rb
qa/spec/scenario/test/integration/oauth_spec.rb
+0
-9
No files found.
app/helpers/auth_helper.rb
View file @
44dc8051
...
...
@@ -30,8 +30,7 @@ module AuthHelper
def
qa_class_for_provider
(
provider
)
{
saml:
'qa-saml-login-button'
,
github:
'qa-github-login-button'
saml:
'qa-saml-login-button'
}[
provider
.
to_sym
]
end
...
...
qa/qa.rb
View file @
44dc8051
...
...
@@ -134,7 +134,6 @@ module QA
autoload
:LDAPNoServer
,
'qa/scenario/test/integration/ldap_no_server'
autoload
:LDAPTLS
,
'qa/scenario/test/integration/ldap_tls'
autoload
:InstanceSAML
,
'qa/scenario/test/integration/instance_saml'
autoload
:OAuth
,
'qa/scenario/test/integration/oauth'
autoload
:Kubernetes
,
'qa/scenario/test/integration/kubernetes'
autoload
:Mattermost
,
'qa/scenario/test/integration/mattermost'
autoload
:ObjectStorage
,
'qa/scenario/test/integration/object_storage'
...
...
@@ -483,17 +482,6 @@ module QA
autoload
:ConfigureJob
,
'qa/vendor/jenkins/page/configure_job'
end
end
module
Github
module
Page
autoload
:Base
,
'qa/vendor/github/page/base'
autoload
:Login
,
'qa/vendor/github/page/login'
end
end
module
OnePassword
autoload
:CLI
,
'qa/vendor/one_password/cli'
end
end
# Classes that provide support to other parts of the framework.
...
...
qa/qa/page/main/login.rb
View file @
44dc8051
...
...
@@ -35,7 +35,6 @@ module QA
view
'app/helpers/auth_helper.rb'
do
element
:saml_login_button
element
:github_login_button
end
view
'app/views/layouts/devise.html.haml'
do
...
...
@@ -139,11 +138,6 @@ module QA
click_element
:standard_tab
end
def
sign_in_with_github
set_initial_password_if_present
click_element
:github_login_button
end
def
sign_in_with_saml
set_initial_password_if_present
click_element
:saml_login_button
...
...
qa/qa/scenario/test/integration/oauth.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
module
QA
module
Scenario
module
Test
module
Integration
class
OAuth
<
Test
::
Instance
::
All
tags
:oauth
end
end
end
end
end
qa/qa/specs/features/browser_ui/1_manage/login/login_via_oauth_spec.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
module
QA
# This test is skipped instead of quarantine because continuously running
# this test may cause the user to hit GitHub's rate limits thus blocking the user.
# Related issue: https://gitlab.com/gitlab-org/gitlab/issues/196517
context
'Manage'
,
:orchestrated
,
:oauth
,
:skip
do
describe
'OAuth login'
do
it
'User logs in to GitLab with GitHub OAuth'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_with_github
)
Vendor
::
Github
::
Page
::
Login
.
perform
(
&
:login
)
expect
(
page
).
to
have_content
(
'Welcome to GitLab'
)
end
end
end
end
qa/qa/vendor/github/page/base.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
module
QA
module
Vendor
module
Github
module
Page
class
Base
include
Capybara
::
DSL
include
Scenario
::
Actable
end
end
end
end
end
qa/qa/vendor/github/page/login.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
require
'capybara/dsl'
require
'benchmark'
module
QA
module
Vendor
module
Github
module
Page
class
Login
<
Page
::
Base
def
login
fill_in
'login'
,
with:
QA
::
Runtime
::
Env
.
github_username
fill_in
'password'
,
with:
QA
::
Runtime
::
Env
.
github_password
click_on
'Sign in'
Support
::
Retrier
.
retry_until
(
raise_on_failure:
true
,
sleep_interval:
35
)
do
fresh_otp
=
nil
time
=
Benchmark
.
realtime
do
fresh_otp
=
OnePassword
::
CLI
.
instance
.
fresh_otp
end
QA
::
Runtime
::
Logger
.
info
(
"Returned fresh_otp:
#{
fresh_otp
}
in
#{
time
}
seconds"
)
fill_in
'otp'
,
with:
fresh_otp
click_on
'Verify'
!
has_text?
(
'Two-factor authentication failed'
,
wait:
1.0
)
end
click_on
'Authorize gitlab-qa'
if
has_button?
(
'Authorize gitlab-qa'
)
end
end
end
end
end
end
qa/qa/vendor/one_password/cli.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
require
'benchmark'
module
QA
module
Vendor
module
OnePassword
class
CLI
include
Singleton
def
initialize
@email
=
QA
::
Runtime
::
Env
.
gitlab_qa_1p_email
@password
=
QA
::
Runtime
::
Env
.
gitlab_qa_1p_password
@secret
=
QA
::
Runtime
::
Env
.
gitlab_qa_1p_secret
@github_uuid
=
QA
::
Runtime
::
Env
.
gitlab_qa_1p_github_uuid
end
def
fresh_otp
otps
=
[]
# Fetches a fresh OTP and returns it only after op provides the same OTP twice
# An OTP is valid for 30 seconds so 70 attempts with 0.5 interval would ensure we complete 1 cycle
Support
::
Retrier
.
retry_until
(
max_attempts:
70
,
sleep_interval:
0.5
)
do
otps
<<
fetch_otp
otps
.
size
>=
3
&&
otps
[
-
1
]
==
otps
[
-
2
]
&&
otps
[
-
1
]
!=
otps
[
-
3
]
end
otps
.
last
end
private
def
fetch_otp
result
=
nil
time
=
Benchmark
.
realtime
do
result
=
`
#{
op_path
}
get totp
#{
@github_uuid
}
--session=
#{
session_token
}
`
.
to_i
end
QA
::
Runtime
::
Logger
.
info
(
"Fetched OTP:
#{
result
}
in:
#{
time
}
seconds"
)
result
end
# OP session tokens are valid for 30 minutes. We are caching the session token here and this is fine currently
# as we just have one test that is not expected to go over 30 minutes.
# But note that if we add more tests that use this class, we might need to add a mechanism to invalidate
# the cache after 30 minutes or if the session_token is rejected by op CLI.
def
session_token
@session_token
||=
`echo '
#{
@password
}
' |
#{
op_path
}
signin gitlab.1password.com
#{
@email
}
#{
@secret
}
--output=raw --shorthand=gitlab_qa`
end
def
op_path
File
.
expand_path
(
File
.
join
(
%W[qa vendor one_password
#{
os
}
op]
))
end
def
os
RUBY_PLATFORM
.
include?
(
"darwin"
)
?
"darwin"
:
"linux"
end
end
end
end
end
qa/qa/vendor/one_password/darwin/op
deleted
100755 → 0
View file @
550d687c
File deleted
qa/qa/vendor/one_password/linux/op
deleted
100755 → 0
View file @
550d687c
File deleted
qa/spec/scenario/test/integration/oauth_spec.rb
deleted
100644 → 0
View file @
550d687c
# frozen_string_literal: true
describe
QA
::
Scenario
::
Test
::
Integration
::
OAuth
do
describe
'#perform'
do
it_behaves_like
'a QA scenario class'
do
let
(
:tags
)
{
[
:oauth
]
}
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