- Fix doctests for Accounts, Agents.Stats, Snmp to match actual behavior - Fix dynamic_extra_test vendor post-processing tests to seed sensor data - Fix activity_controller_test to seed devices for feed data - Fix session_manager_test to create browser session for test - Fix topology_test link creation for connection test - Fix device_monitor/driver_worker tests for unique job constraints - Fix accounts_test expired_tokens assertion (magic link token is expired) - Fix happy_path_test and show_events_test to seed monitor data - Fix admin user_live_test user.name -> user.email (no name field) - Fix schema_test to seed activity data - Fix mobile_qr_live_test to match actual template text - Fix SnmpKit.MIB doctests and tests for enriched return values - Fix onboarding_live, mobile_controller, mib_test weak assertions - Remove dead code and fix credo warnings
45 lines
1.5 KiB
Elixir
45 lines
1.5 KiB
Elixir
defmodule Towerops.PromExTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias PromEx.Plugins.Phoenix
|
|
|
|
describe "plugins/0" do
|
|
test "lists the expected PromEx plugins" do
|
|
plugins = Towerops.PromEx.plugins()
|
|
assert hd(plugins)
|
|
assert PromEx.Plugins.Application in plugins
|
|
assert PromEx.Plugins.Beam in plugins
|
|
assert PromEx.Plugins.PhoenixLiveView in plugins
|
|
assert PromEx.Plugins.Ecto in plugins
|
|
assert PromEx.Plugins.Oban in plugins
|
|
assert Towerops.PromEx.TowerOpsMetrics in plugins
|
|
|
|
# Phoenix plugin is configured with router + endpoint opts
|
|
assert {Phoenix, opts} =
|
|
Enum.find(plugins, &match?({Phoenix, _}, &1))
|
|
|
|
assert opts[:router] == ToweropsWeb.Router
|
|
assert opts[:endpoint] == ToweropsWeb.Endpoint
|
|
end
|
|
end
|
|
|
|
describe "dashboard_assigns/0" do
|
|
test "includes datasource id and selected interval" do
|
|
assigns = Towerops.PromEx.dashboard_assigns()
|
|
assert assigns[:datasource_id] == "Prometheus"
|
|
assert assigns[:default_selected_interval] == "30s"
|
|
end
|
|
end
|
|
|
|
describe "dashboards/0" do
|
|
test "lists the bundled prom_ex dashboards" do
|
|
dashboards = Towerops.PromEx.dashboards()
|
|
assert {:prom_ex, "application.json"} in dashboards
|
|
assert {:prom_ex, "beam.json"} in dashboards
|
|
assert {:prom_ex, "phoenix.json"} in dashboards
|
|
assert {:prom_ex, "phoenix_live_view.json"} in dashboards
|
|
assert {:prom_ex, "ecto.json"} in dashboards
|
|
assert {:prom_ex, "oban.json"} in dashboards
|
|
end
|
|
end
|
|
end
|