Skip to content

Fix broken master: Use UTC for shift times calculated in specs

Sarah Yasonik requested to merge sy-fix-persist-job-dst-issue into master

What does this MR do?

This fixes #323710 (closed).

A couple of the specs in ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb assert that the right shifts are saved to the DB for an on-call rotation, but they failed to account for Daylight Savings Time. The on-call schedule in the spec is tied to Berlin, so the specs started failing once a DST transition came within the tested time range of the tests.

This MR fixes the offending tests, as well as adding traits for all on-call schedule factories to make it easy to switch the timezone of a given schedule to UTC for similar tests in future.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports