Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/child_spec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ defmodule Reactor.Process.Dsl.ChildSpec do
alias Reactor.{Dsl.Argument, Template}

defstruct __identifier__: nil,
__spark_metadata__: nil,
description: nil,
source: nil,
transform: nil

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
description: nil | String.t(),
source: Template.t() | Supervisor.module_spec(),
transform: nil | (any -> Supervisor.module_spec()) | {module, keyword} | mfa
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/count_children.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Reactor.Process.Dsl.CountChildren do
alias Reactor.{Dsl.Argument, Dsl.Guard, Dsl.WaitFor, Dsl.Where, Template}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
description: nil,
guards: [],
Expand All @@ -18,6 +19,7 @@ defmodule Reactor.Process.Dsl.CountChildren do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
description: nil | String.t(),
guards: [Reactor.Guard.Build.t()],
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/delete_child.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Reactor.Process.Dsl.DeleteChild do
alias Reactor.{Dsl.Argument, Dsl.Guard, Dsl.WaitFor, Dsl.Where, Template}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
child_id: nil,
description: nil,
Expand All @@ -19,6 +20,7 @@ defmodule Reactor.Process.Dsl.DeleteChild do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
child_id: Template.t(),
description: nil | String.t(),
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/process_exit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Reactor.Process.Dsl.ProcessExit do
alias Reactor.{Dsl.Argument, Dsl.Guard, Dsl.WaitFor, Dsl.Where, Template}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
guards: [],
name: nil,
Expand All @@ -19,6 +20,7 @@ defmodule Reactor.Process.Dsl.ProcessExit do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
guards: [Reactor.Guard.Build.t()],
name: any,
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/restart_child.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule Reactor.Process.Dsl.RestartChild do
}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
child_id: nil,
description: nil,
Expand All @@ -25,6 +26,7 @@ defmodule Reactor.Process.Dsl.RestartChild do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
child_id: Template.t(),
description: nil | String.t(),
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/start_child.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Reactor.Process.Dsl.StartChild do
alias Reactor.{Dsl.Argument, Dsl.Guard, Dsl.WaitFor, Dsl.Where, Process.Dsl.ChildSpec, Template}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
child_spec: nil,
description: nil,
Expand All @@ -24,6 +25,7 @@ defmodule Reactor.Process.Dsl.StartChild do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
child_spec: ChildSpec.t(),
description: nil | String.t(),
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/start_link.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Reactor.Process.Dsl.StartLink do
alias Reactor.{Dsl.Argument, Dsl.Guard, Dsl.WaitFor, Dsl.Where, Process.Dsl.ChildSpec}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
child_spec: nil,
description: nil,
Expand All @@ -22,6 +23,7 @@ defmodule Reactor.Process.Dsl.StartLink do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
child_spec: ChildSpec.t(),
description: nil | String.t(),
Expand Down
2 changes: 2 additions & 0 deletions lib/reactor/process/dsl/terminate_child.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule Reactor.Process.Dsl.TerminateChild do
}

defstruct __identifier__: nil,
__spark_metadata__: nil,
arguments: [],
child_id: nil,
description: nil,
Expand All @@ -27,6 +28,7 @@ defmodule Reactor.Process.Dsl.TerminateChild do

@type t :: %__MODULE__{
__identifier__: any,
__spark_metadata__: Spark.Dsl.Entity.spark_meta(),
arguments: [Argument.t()],
child_id: Template.t(),
description: nil | String.t(),
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule Reactor.Process.MixProject do
{:git_ops, "~> 2.6", only: ~w[dev test]a, runtime: false},
{:igniter, "~> 0.6", only: ~w[dev test]a},
{:mix_audit, "~> 2.0", only: ~w[dev test]a, runtime: false},
{:reactor, "== 0.15.4"},
{:reactor, "== 0.17.0"},
{:spark, "~> 2.0"}
]
end
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
"nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"},
"owl": {:hex, :owl, "0.13.0", "26010e066d5992774268f3163506972ddac0a7e77bfe57fa42a250f24d6b876e", [:mix], [{:ucwidth, "~> 0.2", [hex: :ucwidth, repo: "hexpm", optional: true]}], "hexpm", "59bf9d11ce37a4db98f57cb68fbfd61593bf419ec4ed302852b6683d3d2f7475"},
"reactor": {:hex, :reactor, "0.15.4", "ef0c56a901c132529a14ab59fed0ccb4fcecb24308fb189a94c908255d4fdafc", [:mix], [{:igniter, "~> 0.4", [hex: :igniter, repo: "hexpm", optional: true]}, {:iterex, "~> 0.1", [hex: :iterex, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:libgraph, "~> 0.16", [hex: :libgraph, repo: "hexpm", optional: false]}, {:spark, "~> 2.0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.11", [hex: :yaml_elixir, repo: "hexpm", optional: false]}, {:ymlr, "~> 5.0", [hex: :ymlr, repo: "hexpm", optional: false]}], "hexpm", "783bf62fd0c72ded033afabdb8b6190b7048769771a2a97256e6f0bf4fb0a891"},
"reactor": {:hex, :reactor, "0.17.0", "eb8bdb530dbae824e2d36a8538f8ec4f3aa7c2d1b61b04959fa787c634f88b49", [:mix], [{:igniter, "~> 0.4", [hex: :igniter, repo: "hexpm", optional: true]}, {:iterex, "~> 0.1", [hex: :iterex, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:libgraph, "~> 0.16", [hex: :libgraph, repo: "hexpm", optional: false]}, {:spark, ">= 2.3.3 and < 3.0.0-0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.11", [hex: :yaml_elixir, repo: "hexpm", optional: false]}, {:ymlr, "~> 5.0", [hex: :ymlr, repo: "hexpm", optional: false]}], "hexpm", "3c3bf71693adbad9117b11ec83cfed7d5851b916ade508ed9718de7ae165bf25"},
"req": {:hex, :req, "0.5.15", "662020efb6ea60b9f0e0fac9be88cd7558b53fe51155a2d9899de594f9906ba9", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 2.0.6 or ~> 2.1", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "a6513a35fad65467893ced9785457e91693352c70b58bbc045b47e5eb2ef0c53"},
"rewrite": {:hex, :rewrite, "1.1.2", "f5a5d10f5fed1491a6ff48e078d4585882695962ccc9e6c779bae025d1f92eda", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}, {:text_diff, "~> 0.1", [hex: :text_diff, repo: "hexpm", optional: false]}], "hexpm", "7f8b94b1e3528d0a47b3e8b7bfeca559d2948a65fa7418a9ad7d7712703d39d4"},
"sourceror": {:hex, :sourceror, "1.10.0", "38397dedbbc286966ec48c7af13e228b171332be1ad731974438c77791945ce9", [:mix], [], "hexpm", "29dbdfc92e04569c9d8e6efdc422fc1d815f4bd0055dc7c51b8800fb75c4b3f1"},
"spark": {:hex, :spark, "2.2.63", "bc771c3c1028136559507e235e721e730118ca316e22e75da347ae1c195b94a1", [:mix], [{:igniter, ">= 0.3.64 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: true]}, {:sourceror, "~> 1.2", [hex: :sourceror, repo: "hexpm", optional: true]}], "hexpm", "42708ab2884af6abc1aa33aa981a4f51f65146d7879651d1e6c11948a4d8fcfe"},
"spark": {:hex, :spark, "2.3.5", "f30d30ecc3b4ab9b932d9aada66af7677fc1f297a2c349b0bcec3eafb9f996e8", [:mix], [{:igniter, ">= 0.3.64 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: true]}, {:sourceror, "~> 1.2", [hex: :sourceror, repo: "hexpm", optional: true]}], "hexpm", "0e9d339704d5d148f77f2b2fef3bcfc873a9e9bb4224fcf289c545d65827202f"},
"spitfire": {:hex, :spitfire, "0.2.1", "29e154873f05444669c7453d3d931820822cbca5170e88f0f8faa1de74a79b47", [:mix], [], "hexpm", "6eeed75054a38341b2e1814d41bb0a250564092358de2669fdb57ff88141d91b"},
"splode": {:hex, :splode, "0.2.9", "3a2776e187c82f42f5226b33b1220ccbff74f4bcc523dd4039c804caaa3ffdc7", [:mix], [], "hexpm", "8002b00c6e24f8bd1bcced3fbaa5c33346048047bb7e13d2f3ad428babbd95c3"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"text_diff": {:hex, :text_diff, "0.1.0", "1caf3175e11a53a9a139bc9339bd607c47b9e376b073d4571c031913317fecaa", [:mix], [], "hexpm", "d1ffaaecab338e49357b6daa82e435f877e0649041ace7755583a0ea3362dbd7"},
"yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"},
"yaml_elixir": {:hex, :yaml_elixir, "2.11.0", "9e9ccd134e861c66b84825a3542a1c22ba33f338d82c07282f4f1f52d847bd50", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "53cc28357ee7eb952344995787f4bb8cc3cecbf189652236e9b163e8ce1bc242"},
"ymlr": {:hex, :ymlr, "5.1.3", "a8061add5a378e20272a31905be70209a5680fdbe0ad51f40cb1af4bdd0a010b", [:mix], [], "hexpm", "8663444fa85101a117887c170204d4c5a2182567e5f84767f0071cf15f2efb1e"},
"yaml_elixir": {:hex, :yaml_elixir, "2.12.0", "30343ff5018637a64b1b7de1ed2a3ca03bc641410c1f311a4dbdc1ffbbf449c7", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "ca6bacae7bac917a7155dca0ab6149088aa7bc800c94d0fe18c5238f53b313c6"},
"ymlr": {:hex, :ymlr, "5.1.4", "b924d61e1fc1ec371cde6ab3ccd9311110b1e052fc5c2460fb322e8380e7712a", [:mix], [], "hexpm", "75f16cf0709fbd911b30311a0359a7aa4b5476346c01882addefd5f2b1cfaa51"},
}
28 changes: 16 additions & 12 deletions test/reactor/process/terminate_child_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
defmodule Reactor.Process.TerminateChildTest do
@moduledoc false
use ExUnit.Case, async: true
import ExUnit.CaptureIO

defmodule TerminateChildReactor do
@moduledoc false
Expand Down Expand Up @@ -60,18 +61,21 @@ defmodule Reactor.Process.TerminateChildTest do
end

test "it fails verification when `restart_on_undo?` is `true` but the module doesn't support it" do
assert_raise(Spark.Error.DslError, ~r/does not export/, fn ->
defmodule FailVerificationReactor do
@moduledoc false
use Reactor, extensions: [Reactor.Process]

terminate_child :terminate_child do
supervisor value(MyApp.Supervisor)
child_id value(MyApp.Worker)
restart_on_undo? true
module DynamicSupervisor
logs =
capture_io(:stderr, fn ->
defmodule FailVerificationReactor do
@moduledoc false
use Reactor, extensions: [Reactor.Process]

terminate_child :terminate_child do
supervisor value(MyApp.Supervisor)
child_id value(MyApp.Worker)
restart_on_undo? true
module DynamicSupervisor
end
end
end
end)
end)

assert logs =~ "does not export"
end
end
Loading