towerops/test/test_helper.exs
2026-01-23 12:52:17 -06:00

36 lines
992 B
Elixir

ExUnit.start()
# Exclude tests by default
# Run specific tests with: mix test --only <tag>
ExUnit.configure(
exclude: [
:integration,
# SnmpKit-specific exclusions
:performance,
:snmpv3,
:memory,
:shell_integration,
:optional,
:needs_simulator,
:manual,
:real_device,
:yecc_required
]
)
# Define mocks for testing
Mox.defmock(Towerops.Monitoring.PingMock, for: Towerops.Monitoring.PingBehaviour)
Mox.defmock(Towerops.Snmp.PollerMock, for: Towerops.Snmp.PollerBehaviour)
Mox.defmock(Towerops.Snmp.SnmpMock, for: Towerops.Snmp.SnmpBehaviour)
# Define stub module for SNMP mock (returns errors for all calls)
defmodule Towerops.Snmp.SnmpMockStub do
@moduledoc false
@behaviour Towerops.Snmp.SnmpBehaviour
def get(_target, _oid, _opts), do: {:error, :timeout}
def walk(_target, _oid, _opts), do: {:error, :timeout}
def get_bulk(_target, _oid, _opts), do: {:error, :timeout}
end
Ecto.Adapters.SQL.Sandbox.mode(Towerops.Repo, :manual)