Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove deprecated Graph #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 0 additions & 7 deletions lib/trailblazer/activity/introspect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ def self.render_task(proc)

proc.inspect
end

# TODO: remove with 0.1.0.
def self.Graph(*args)
Deprecate.warn caller_locations[0], %(`Trailblazer::Activity::Introspect::Graph` is deprecated. Please use `Trailblazer::Developer::Introspect.Graph`)

Trailblazer::Developer::Introspect::Graph.new(*args)
end
end # Introspect
end
end
4 changes: 2 additions & 2 deletions test/introspect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ class IntrospectionTest < Minitest::Spec
activity = nested_activity(flat_activity: b_activity, d_id: :Delete) # [B, Delete=[B, D=[B, C], E], E]

#@ find top-activity which returns a special Node.
node, host_activity, graph = Trailblazer::Activity::Introspect.find_path(activity, [])
node, host_activity, _graph = Trailblazer::Activity::Introspect.find_path(activity, [])
assert_equal node.class, Trailblazer::Activity::Schema::Nodes::Attributes
assert_equal node[:task], activity
assert_equal host_activity, Trailblazer::Activity::TaskWrap.container_activity_for(activity)

#@ one element path
node, host_activity, graph = Trailblazer::Activity::Introspect.find_path(activity, [:E])
node, host_activity, _graph = Trailblazer::Activity::Introspect.find_path(activity, [:E])
assert_equal node.class, Trailblazer::Activity::Schema::Nodes::Attributes
assert_equal node[:task], Implementing.method(:f)
assert_equal host_activity, activity
Expand Down
4 changes: 2 additions & 2 deletions test/task_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ def process_type(ctx, model:, **)
)

ctx = {mode: Object}
signal, (ctx, flow_options) = circuit_task.([ctx, {}], **{exec_context: nil})
signal, (ctx, _flow_options) = circuit_task.([ctx, {}], **{exec_context: nil})

assert_equal signal, Trailblazer::Activity::Right
assert_equal ctx.inspect, %{{:mode=>Object, :nested_activity=>Object}}

#@ returning false
ctx = {mode: false}
signal, (ctx, flow_options) = circuit_task.([ctx, {}], **{exec_context: nil})
signal, (ctx, _flow_options) = circuit_task.([ctx, {}], **{exec_context: nil})

assert_equal signal, Trailblazer::Activity::Left
assert_equal ctx.inspect, %{{:mode=>false, :nested_activity=>false}}
Expand Down
6 changes: 3 additions & 3 deletions test/testing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def self.b((ctx, flow_options), **)
end
end

activity = flat_activity(implementing: implementing)
_activity = flat_activity(implementing: implementing)
end

#0001
Expand Down Expand Up @@ -179,7 +179,7 @@ def invisible
#0001
#@ test that we can pass {:circuit_options}
it {
signal, (ctx, flow_options) = assert_invoke activity, seq: "[:call]", circuit_options: {start: "yes"}
_signal, (ctx, _flow_options) = assert_invoke activity, seq: "[:call]", circuit_options: {start: "yes"}

assert_equal ctx.invisible[:circuit_options].keys.inspect, %([:start, :runner, :wrap_runtime, :activity])
assert_equal ctx.invisible[:circuit_options][:start], "yes"
Expand All @@ -189,7 +189,7 @@ def invisible
#0002
#@ test that we can pass {:flow_options}
it {
signal, (ctx, flow_options) = assert_invoke activity, seq: "[:call]", flow_options: {start: "yes"}
_signal, (ctx, _flow_options) = assert_invoke activity, seq: "[:call]", flow_options: {start: "yes"}

assert_equal ctx.invisible[:flow_options].keys.inspect, %([:start])
assert_equal ctx.invisible[:flow_options][:start], "yes"
Expand Down
9 changes: 4 additions & 5 deletions test/wrap/task_wrap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def add_2(wrap_ctx, original_args)
end

def abc_intermediate
intermediate = Inter.new(
_intermediate = Inter.new(
{
Inter::TaskRef(:a) => [Inter::Out(:success, :b)],
Inter::TaskRef(:b) => [Inter::Out(:success, :c)],
Expand Down Expand Up @@ -156,7 +156,7 @@ def change_start_task(wrap_ctx, original_args)

it "deprecates Pipeline.method(:insert) and friends" do
merge = nil
out, err = capture_io do
_out, err = capture_io do
merge = [
[TaskWrap::Pipeline.method(:insert_before), "task_wrap.call_task", ["user.add_1", method(:add_1)]],
[TaskWrap::Pipeline.method(:insert_after), "task_wrap.call_task", ["user.add_2", method(:add_2)]]
Expand All @@ -171,7 +171,7 @@ def change_start_task(wrap_ctx, original_args)
}

ext = nil
out, err = capture_io do
_out, err = capture_io do
ext = TaskWrap.Extension(merge: merge) # {:merge} option is deprecated, too.
end
line_no = __LINE__
Expand All @@ -196,8 +196,7 @@ def change_start_task(wrap_ctx, original_args)
assert_invoke(Activity.new(schema), seq: "[:a, :b, 1, :c, 2]", circuit_options: {wrap_runtime: wrap_runtime})

#@ using {Pipeline::Merge.new} also gets deprecated
ext = nil
out, err = capture_io do
_out, err = capture_io do
wrap_runtime = {abc_implementation[:c].circuit_task => TaskWrap::Pipeline::Merge.new(*merge)}
end
line_no = __LINE__
Expand Down
Loading