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
7feb5751
Commit
7feb5751
authored
Mar 08, 2021
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use UTC for shift times calculated in specs
parent
583b4221
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
1 deletion
+17
-1
ee/spec/factories/incident_management/oncall_participant.rb
ee/spec/factories/incident_management/oncall_participant.rb
+4
-0
ee/spec/factories/incident_management/oncall_rotations.rb
ee/spec/factories/incident_management/oncall_rotations.rb
+4
-0
ee/spec/factories/incident_management/oncall_schedules.rb
ee/spec/factories/incident_management/oncall_schedules.rb
+4
-0
ee/spec/factories/incident_management/oncall_shifts.rb
ee/spec/factories/incident_management/oncall_shifts.rb
+4
-0
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb
...nt_management/oncall_rotations/persist_shifts_job_spec.rb
+1
-1
No files found.
ee/spec/factories/incident_management/oncall_participant.rb
View file @
7feb5751
...
@@ -16,5 +16,9 @@ FactoryBot.define do
...
@@ -16,5 +16,9 @@ FactoryBot.define do
trait
:removed
do
trait
:removed
do
is_removed
{
true
}
is_removed
{
true
}
end
end
trait
:utc
do
association
:rotation
,
:utc
,
factory: :incident_management_oncall_rotation
end
end
end
end
end
ee/spec/factories/incident_management/oncall_rotations.rb
View file @
7feb5751
...
@@ -21,5 +21,9 @@ FactoryBot.define do
...
@@ -21,5 +21,9 @@ FactoryBot.define do
create
(
:incident_management_oncall_participant
,
rotation:
rotation
,
user:
user
)
create
(
:incident_management_oncall_participant
,
rotation:
rotation
,
user:
user
)
end
end
end
end
trait
:utc
do
association
:schedule
,
:utc
,
factory: :incident_management_oncall_schedule
end
end
end
end
end
ee/spec/factories/incident_management/oncall_schedules.rb
View file @
7feb5751
...
@@ -6,5 +6,9 @@ FactoryBot.define do
...
@@ -6,5 +6,9 @@ FactoryBot.define do
sequence
(
:name
)
{
|
n
|
"On-call Schedule #
#{
n
}
"
}
sequence
(
:name
)
{
|
n
|
"On-call Schedule #
#{
n
}
"
}
description
{
'On-call description'
}
description
{
'On-call description'
}
timezone
{
'Europe/Berlin'
}
timezone
{
'Europe/Berlin'
}
trait
:utc
do
timezone
{
'Etc/UTC'
}
end
end
end
end
end
ee/spec/factories/incident_management/oncall_shifts.rb
View file @
7feb5751
...
@@ -6,5 +6,9 @@ FactoryBot.define do
...
@@ -6,5 +6,9 @@ FactoryBot.define do
rotation
{
participant
.
rotation
}
rotation
{
participant
.
rotation
}
starts_at
{
rotation
.
starts_at
}
starts_at
{
rotation
.
starts_at
}
ends_at
{
starts_at
+
rotation
.
shift_cycle_duration
}
ends_at
{
starts_at
+
rotation
.
shift_cycle_duration
}
trait
:utc
do
association
:participant
,
:utc
,
:with_developer_access
,
factory: :incident_management_oncall_participant
end
end
end
end
end
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb
View file @
7feb5751
...
@@ -91,7 +91,7 @@ RSpec.describe IncidentManagement::OncallRotations::PersistShiftsJob do
...
@@ -91,7 +91,7 @@ RSpec.describe IncidentManagement::OncallRotations::PersistShiftsJob do
end
end
context
'when rotation has saved shifts'
do
context
'when rotation has saved shifts'
do
let_it_be
(
:existing_shift
)
{
create
(
:incident_management_oncall_shift
)
}
let_it_be
(
:existing_shift
)
{
create
(
:incident_management_oncall_shift
,
:utc
)
}
let_it_be_with_reload
(
:rotation
)
{
existing_shift
.
rotation
}
let_it_be_with_reload
(
:rotation
)
{
existing_shift
.
rotation
}
context
'when current time is during a saved shift'
do
context
'when current time is during a saved shift'
do
...
...
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