-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Address steps no longer requiring current job ids * Add UsageTracking crons to Oban plugins * Update Changelog * Update test and fix typo
- Loading branch information
1 parent
628f2ff
commit e960141
Showing
6 changed files
with
93 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
defmodule Lightning.ApplicationTest do | ||
use Lightning.DataCase, async: true | ||
|
||
alias Lightning.Config | ||
|
||
import Lightning.ApplicationHelpers, only: [put_temporary_env: 3] | ||
|
||
describe ".oban_opts/0" do | ||
test "returns the Oban configuration with usage tracking cron options" do | ||
put_temporary_env( | ||
:lightning, | ||
:usage_tracking, | ||
enabled: true, | ||
daily_batch_size: 100, | ||
resubmission_batch_size: 100 | ||
) | ||
|
||
before_config = Application.get_env(:lightning, Oban) | ||
plugins = before_config |> Keyword.fetch!(:plugins) | ||
before_cron_plugin = plugins |> Keyword.fetch!(Oban.Plugins.Cron) | ||
before_crontab = before_cron_plugin |> Keyword.fetch!(:crontab) | ||
|
||
expected_crontab = before_crontab ++ Config.usage_tracking_cron_opts() | ||
|
||
expected_plugins = | ||
Keyword.put( | ||
plugins, | ||
Oban.Plugins.Cron, | ||
crontab: expected_crontab | ||
) | ||
|
||
after_config = Lightning.Application.oban_opts() | ||
after_plugins = after_config |> Keyword.fetch!(:plugins) | ||
|
||
assert after_plugins == expected_plugins | ||
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