Skip to content

Commit

Permalink
skip job sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedrelick committed Aug 19, 2024
1 parent 9135da7 commit e866c1e
Showing 1 changed file with 40 additions and 39 deletions.
79 changes: 40 additions & 39 deletions test/agens/job_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,45 +71,46 @@ defmodule Agens.JobTest do
end
end

# describe "job" do
# setup :start_job

# @tag capture_log: true
# test "start", %{job: %{name: name}, pid: pid} do
# input = "D"

# assert is_pid(pid)
# assert Job.run(name, input) == :ok

# assert_receive {:job_started, ^name}

# # 0
# assert_receive {:step_started, {^name, 0}, "D"}
# assert_receive {:step_result, {^name, 0}, "C"}
# assert_receive {:step_started, {^name, 1}, "C"}
# assert_receive {:step_result, {^name, 1}, "E"}
# assert_receive {:step_started, {^name, 2}, "E"}
# assert_receive {:step_result, {^name, 2}, "E"}

# # 1
# assert_receive {:step_started, {^name, 0}, "E"}
# assert_receive {:step_result, {^name, 0}, "D"}
# assert_receive {:step_started, {^name, 1}, "D"}
# assert_receive {:step_result, {^name, 1}, "F"}
# assert_receive {:step_started, {^name, 2}, "F"}
# assert_receive {:step_result, {^name, 2}, "F"}

# # 2
# assert_receive {:step_started, {^name, 0}, "F"}
# assert_receive {:step_result, {^name, 0}, "E"}
# assert_receive {:step_started, {^name, 1}, "E"}
# assert_receive {:step_result, {^name, 1}, "G"}
# assert_receive {:step_started, {^name, 2}, "G"}
# assert_receive {:step_result, {^name, 2}, "TRUE"}

# assert_receive {:job_ended, ^name, :complete}
# end
# end
describe "sequence" do
setup :start_job

@tag capture_log: true
@tag :skip
test "start", %{job: %{name: name}, pid: pid} do
input = "D"

assert is_pid(pid)
assert Job.run(name, input) == :ok

assert_receive {:job_started, ^name}

# 0
assert_receive {:step_started, {^name, 0}, "D"}
assert_receive {:step_result, {^name, 0}, "C"}
assert_receive {:step_started, {^name, 1}, "C"}
assert_receive {:step_result, {^name, 1}, "E"}
assert_receive {:step_started, {^name, 2}, "E"}
assert_receive {:step_result, {^name, 2}, "E"}

# 1
assert_receive {:step_started, {^name, 0}, "E"}
assert_receive {:step_result, {^name, 0}, "D"}
assert_receive {:step_started, {^name, 1}, "D"}
assert_receive {:step_result, {^name, 1}, "F"}
assert_receive {:step_started, {^name, 2}, "F"}
assert_receive {:step_result, {^name, 2}, "F"}

# 2
assert_receive {:step_started, {^name, 0}, "F"}
assert_receive {:step_result, {^name, 0}, "E"}
assert_receive {:step_started, {^name, 1}, "E"}
assert_receive {:step_result, {^name, 1}, "G"}
assert_receive {:step_started, {^name, 2}, "G"}
assert_receive {:step_result, {^name, 2}, "TRUE"}

assert_receive {:job_ended, ^name, :complete}
end
end

describe "restart" do
setup [:start_agens, :start_serving]
Expand Down

0 comments on commit e866c1e

Please sign in to comment.