-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vebt 765 - Modify BDN generation to account for holidays (#19641)
* Skip holidays for ClearDeactivatedBdns periodic job * Account for holidays for ingress jobs * Add comment detailing ingress job skips on holidays * Revert previous change from different job * Add rspec test for holidays * Add codeowners for rspec file * Add all VYE scripts to holiday skipping logic * Remove empty PurgeStaleVerifications method from Sundown Sweep * Remove PurgeStaleVerifications from sundown sweep spec * Realphabetize codeowner file * Fix relative import error * Remove duplicate import * Remove reference to purge stale verifications * Move holidays logic into VYE scripts * Add holidays logic testing to rspec * Move holidays logic to cloud transfer * Fix linting errors
- Loading branch information
1 parent
8a87d36
commit 7ea8d81
Showing
19 changed files
with
279 additions
and
116 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
modules/vye/app/sidekiq/vye/sundown_sweep/purge_stale_verifications.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 36 additions & 10 deletions
46
modules/vye/spec/sidekiq/vye/dawn_dash/activate_bdn_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,48 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require Vye::Engine.root / 'spec/rails_helper' | ||
require 'timecop' | ||
|
||
describe Vye::DawnDash::ActivateBdn, type: :worker do | ||
describe Vye::SundownSweep::DeleteProcessedS3Files, type: :worker do | ||
before do | ||
Sidekiq::Worker.clear_all | ||
Sidekiq::Job.clear_all | ||
end | ||
|
||
it 'enqueues child jobs' do | ||
expect(Vye::BdnClone).to receive(:activate_injested!) | ||
context 'when it is not a holiday' do | ||
before do | ||
Timecop.freeze(Time.zone.local(2024, 7, 2)) # Regular work day | ||
end | ||
|
||
expect do | ||
described_class.perform_async | ||
end.to change { Sidekiq::Worker.jobs.size }.by(1) | ||
after do | ||
Timecop.return | ||
end | ||
|
||
described_class.drain | ||
it 'checks the existence of described_class' do | ||
expect(Vye::CloudTransfer).to receive(:remove_aws_files_from_s3_buckets) | ||
|
||
expect(Vye::DawnDash::EgressUpdates).to have_enqueued_sidekiq_job | ||
expect do | ||
described_class.perform_async | ||
end.to change { Sidekiq::Worker.jobs.size }.by(1) | ||
|
||
described_class.drain | ||
end | ||
end | ||
|
||
context 'when it is a holiday' do | ||
before do | ||
Timecop.freeze(Time.zone.local(2024, 7, 4)) # Independence Day | ||
end | ||
|
||
after do | ||
Timecop.return | ||
end | ||
|
||
it 'does not process S3 files' do | ||
expect(Vye::CloudTransfer).not_to receive(:remove_aws_files_from_s3_buckets) | ||
|
||
expect do | ||
described_class.new.perform | ||
end.not_to(change { Sidekiq::Worker.jobs.size }) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.