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
205cb0c6
Commit
205cb0c6
authored
Oct 09, 2018
by
Filipa Lacerda
Committed by
Tim Zallmann
Oct 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hides shared runner limit when user has minutes
parent
84e79476
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletion
+78
-1
app/assets/javascripts/jobs/store/getters.js
app/assets/javascripts/jobs/store/getters.js
+9
-1
ee/changelogs/unreleased/7938-runners-bug.yml
ee/changelogs/unreleased/7938-runners-bug.yml
+5
-0
ee/spec/features/projects/jobs_spec.rb
ee/spec/features/projects/jobs_spec.rb
+12
-0
spec/javascripts/jobs/store/getters_spec.js
spec/javascripts/jobs/store/getters_spec.js
+52
-0
No files found.
app/assets/javascripts/jobs/store/getters.js
View file @
205cb0c6
...
...
@@ -50,8 +50,16 @@ export const isJobStuck = state =>
(
!
_
.
isEmpty
(
state
.
job
.
runners
)
&&
state
.
job
.
runners
.
available
===
false
);
// ee-only start
/**
* Shared runners limit is only rendered when
* used quota is bigger or equal than the limit
*
* @returns {Boolean}
*/
export
const
shouldRenderSharedRunnerLimitWarning
=
state
=>
state
.
job
.
runners
&&
state
.
job
.
runners
.
quota
&&
state
.
job
.
runners
.
quota
.
used
;
!
_
.
isEmpty
(
state
.
job
.
runners
)
&&
!
_
.
isEmpty
(
state
.
job
.
runners
.
quota
)
&&
state
.
job
.
runners
.
quota
.
used
>=
state
.
job
.
runners
.
quota
.
limit
;
// ee-only end
// prevent babel-plugin-rewire from generating an invalid default during karma tests
...
...
ee/changelogs/unreleased/7938-runners-bug.yml
0 → 100644
View file @
205cb0c6
---
title
:
Fixes warning for used minutes in runner showing when user still has minutes
merge_request
:
7843
author
:
type
:
fixed
ee/spec/features/projects/jobs_spec.rb
View file @
205cb0c6
...
...
@@ -25,5 +25,17 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
expect
(
page
).
to
have_content
(
'You have used all your shared Runners pipeline minutes.'
)
end
end
context
'job project is not over shared runners limit'
do
let
(
:group
)
{
create
(
:group
,
:with_not_used_build_minutes_limit
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
shared_runners_enabled:
true
)
}
it
'does not display a warning message'
do
visit
project_job_path
(
project
,
job
)
wait_for_requests
expect
(
page
).
not_to
have_content
(
'You have used all your shared Runners pipeline minutes.'
)
end
end
end
end
spec/javascripts/jobs/store/getters_spec.js
View file @
205cb0c6
...
...
@@ -210,4 +210,56 @@ describe('Job Store Getters', () => {
});
});
});
describe
(
'
shouldRenderSharedRunnerLimitWarning
'
,
()
=>
{
describe
(
'
without runners information
'
,
()
=>
{
it
(
'
returns false
'
,
()
=>
{
expect
(
getters
.
shouldRenderSharedRunnerLimitWarning
(
localState
)).
toEqual
(
false
);
});
});
describe
(
'
with runners information
'
,
()
=>
{
describe
(
'
when used quota is less than limit
'
,
()
=>
{
it
(
'
returns false
'
,
()
=>
{
localState
.
job
.
runners
=
{
quota
:
{
used
:
33
,
limit
:
2000
,
},
available
:
true
,
online
:
true
,
};
expect
(
getters
.
shouldRenderSharedRunnerLimitWarning
(
localState
)).
toEqual
(
false
);
});
});
describe
(
'
when used quota is equal to limit
'
,
()
=>
{
it
(
'
returns true
'
,
()
=>
{
localState
.
job
.
runners
=
{
quota
:
{
used
:
2000
,
limit
:
2000
,
},
available
:
true
,
online
:
true
,
};
expect
(
getters
.
shouldRenderSharedRunnerLimitWarning
(
localState
)).
toEqual
(
true
);
});
});
describe
(
'
when used quota is bigger than limit
'
,
()
=>
{
it
(
'
returns true
'
,
()
=>
{
localState
.
job
.
runners
=
{
quota
:
{
used
:
2002
,
limit
:
2000
,
},
available
:
true
,
online
:
true
,
};
expect
(
getters
.
shouldRenderSharedRunnerLimitWarning
(
localState
)).
toEqual
(
true
);
});
});
});
});
});
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