Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

413 B
Raw Blame
package unifiedresources

import (
	"sync"
	"testing"

	"github.com/rcourtman/pulse-go-rewrite/internal/mockruntime"
)

var mockModeTestMu sync.Mutex

func enableMockMode(t *testing.T) {
	t.Helper()
	mockModeTestMu.Lock()
	previous := mockruntime.IsEnabled()
	t.Setenv("PULSE_MOCK_MODE", "true")
	mockruntime.SetEnabled(true)
	t.Cleanup(func() {
		mockruntime.SetEnabled(previous)
		mockModeTestMu.Unlock()
	})
}