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
7794c857
Commit
7794c857
authored
Jan 08, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ce-to-ee-2018-01-07' into 'master'
CE upstream - Sunday See merge request gitlab-org/gitlab-ee!3953
parents
d95592d1
dc073212
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
app/workers/check_gcp_project_billing_worker.rb
app/workers/check_gcp_project_billing_worker.rb
+4
-1
spec/features/projects/clusters/gcp_spec.rb
spec/features/projects/clusters/gcp_spec.rb
+1
-1
spec/features/projects/clusters_spec.rb
spec/features/projects/clusters_spec.rb
+14
-0
spec/workers/check_gcp_project_billing_worker_spec.rb
spec/workers/check_gcp_project_billing_worker_spec.rb
+1
-1
No files found.
app/workers/check_gcp_project_billing_worker.rb
View file @
7794c857
...
...
@@ -6,6 +6,7 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT
=
15
.
seconds
.
to_i
SESSION_KEY_TIMEOUT
=
5
.
minutes
BILLING_TIMEOUT
=
1
.
hour
def
self
.
get_session_token
(
token_key
)
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
...
...
@@ -34,7 +35,9 @@ class CheckGcpProjectBillingWorker
billing_enabled_projects
=
CheckGcpProjectBillingService
.
new
.
execute
(
token
)
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
redis
.
set
(
self
.
class
.
redis_shared_state_key_for
(
token
),
!
billing_enabled_projects
.
empty?
)
redis
.
set
(
self
.
class
.
redis_shared_state_key_for
(
token
),
!
billing_enabled_projects
.
empty?
,
ex:
BILLING_TIMEOUT
)
end
end
...
...
spec/features/projects/clusters/gcp_spec.rb
View file @
7794c857
...
...
@@ -87,7 +87,7 @@ feature 'Gcp Cluster', :js do
end
it
'user sees a cluster details page'
do
expect
(
page
).
to
have_button
(
'Save'
)
expect
(
page
).
to
have_button
(
'Save
changes
'
)
expect
(
page
.
find
(
:css
,
'.cluster-name'
).
value
).
to
eq
(
cluster
.
name
)
end
...
...
spec/features/projects/clusters_spec.rb
View file @
7794c857
...
...
@@ -77,4 +77,18 @@ feature 'Clusters', :js do
end
end
end
context
'when user has not signed in Google'
do
before
do
visit
project_clusters_path
(
project
)
click_link
'Add cluster'
click_link
'Create on GKE'
end
it
'user sees a login page'
do
expect
(
page
).
to
have_css
(
'.signin-with-google'
)
expect
(
page
).
to
have_link
(
'Google account'
)
end
end
end
spec/workers/check_gcp_project_billing_worker_spec.rb
View file @
7794c857
...
...
@@ -27,7 +27,7 @@ describe CheckGcpProjectBillingWorker do
expect
(
CheckGcpProjectBillingService
).
to
receive_message_chain
(
:new
,
:execute
).
and_return
([
double
])
expect
(
Gitlab
::
Redis
::
SharedState
).
to
receive
(
:with
).
and_yield
(
redis_double
)
expect
(
redis_double
).
to
receive
(
:set
).
with
(
described_class
.
redis_shared_state_key_for
(
token
),
anything
)
expect
(
redis_double
).
to
receive
(
:set
).
with
(
described_class
.
redis_shared_state_key_for
(
token
),
anything
,
anything
)
subject
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