Skip to content

Commit

Permalink
test: consistent test folder structure with lib
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Aug 23, 2024
1 parent fa2fc81 commit e917b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ defmodule TowerObanTest do

use AssertEventually, timeout: 100, interval: 10

import ExUnit.CaptureLog, only: [capture_log: 1]

setup do
start_link_supervised!(Tower.EphemeralReporter)

Expand All @@ -18,9 +16,7 @@ defmodule TowerObanTest do
{Oban, engine: Oban.Engines.Lite, repo: TestApp.Repo, queues: [default: 10]}
)

capture_log(fn ->
Ecto.Migrator.up(TestApp.Repo, 0, TestApp.Repo.Migrations.AddOban)
end)
Ecto.Migrator.up(TestApp.Repo, 0, TestApp.Repo.Migrations.AddOban)

Tower.attach()

Expand All @@ -29,6 +25,7 @@ defmodule TowerObanTest do
end)
end

@tag capture_log: true
test "reports raised exception in an Oban worker" do
TestApp.ArithmeticErrorWorker.new(%{}, max_attempts: 1)
|> Oban.insert()
Expand All @@ -51,6 +48,7 @@ defmodule TowerObanTest do
assert is_list(stacktrace)
end

@tag capture_log: true
test "reports uncaught throw generated in an Oban worker" do
TestApp.UncaughtThrowWorker.new(%{}, max_attempts: 1)
|> Oban.insert()
Expand All @@ -73,6 +71,7 @@ defmodule TowerObanTest do
assert is_list(stacktrace)
end

@tag capture_log: true
test "reports abnormal exit generated in an Oban worker" do
TestApp.AbnormalExitWorker.new(%{}, max_attempts: 1)
|> Oban.insert()
Expand Down
File renamed without changes.

0 comments on commit e917b57

Please sign in to comment.