You've already forked tribes-plugin-supertest
forked from tribes/tribes-plugin-template
6caccf23a6
Add supertest scheduler cron workers and local API endpoints that record singleton and all-nodes scheduler executions into synced supertest cases.\n\nThe probe API lets live supertest scenarios start, inspect, and stop scheduler assertions without adding a separate resource.
22 lines
774 B
Elixir
22 lines
774 B
Elixir
defmodule TribeOne.TribesPlugin.Supertest.SchedulerContractTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
test "declares scheduler probe cron workers" do
|
|
spec = TribeOne.TribesPlugin.Supertest.Plugin.register(%{})
|
|
|
|
crons = Map.fetch!(spec, :scheduler_crons)
|
|
|
|
assert Enum.any?(crons, fn cron ->
|
|
cron.id == "scheduler.singleton_counter" and
|
|
cron.mode == :singleton and
|
|
cron.worker == TribeOne.TribesPlugin.Supertest.Scheduler.SingletonCounterWorker
|
|
end)
|
|
|
|
assert Enum.any?(crons, fn cron ->
|
|
cron.id == "scheduler.all_nodes_counter" and
|
|
cron.mode == :all_nodes and
|
|
cron.worker == TribeOne.TribesPlugin.Supertest.Scheduler.AllNodesCounterWorker
|
|
end)
|
|
end
|
|
end
|