Skip to content

Commit f4395cb

Browse files
fix: switch Oban to manual testing mode to eliminate spurious compile errors
The inline testing mode caused CompileWorker to run immediately on every bundle creation, failing with "zentinel binary not found" since the CLI isn't available in tests. Manual mode lets bundles stay in pending state naturally, and tests that need compiled bundles use compiled_bundle_fixture.
1 parent ab7730a commit f4395cb

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

config/test.exs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ config :swoosh, :api_client, false
2525
# Print only warnings and errors during test
2626
config :logger, level: :warning
2727

28-
# Disable Oban queues during tests (use Oban.Testing)
29-
config :zentinel_cp, Oban, testing: :inline
28+
# Use manual Oban testing mode — jobs are not executed automatically.
29+
# Tests that need compiled bundles should use compiled_bundle_fixture/1.
30+
# Tests that need to run workers explicitly can use Oban.drain_queue/1.
31+
config :zentinel_cp, Oban, testing: :manual
3032

3133
# Mark test environment (used to skip async notifications)
3234
config :zentinel_cp, :env, :test

test/zentinel_cp/bundles_test.exs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ defmodule ZentinelCp.BundlesTest do
107107
project = project_fixture()
108108
_bundle = bundle_fixture(%{project: project})
109109

110-
# Oban inline mode runs the compile worker synchronously,
111-
# which changes status from "pending" to "failed" (no zentinel binary in test)
112-
bundles = Bundles.list_bundles(project.id, status: "failed")
110+
# With manual Oban testing, bundles stay "pending" after creation
111+
bundles = Bundles.list_bundles(project.id, status: "pending")
113112
assert length(bundles) == 1
114113

115114
bundles = Bundles.list_bundles(project.id, status: "compiled")

0 commit comments

Comments
 (0)