package meshxruntime

import (
	"os/exec"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestRuntimeTopologyGuardrails(t *testing.T) {
	repositoryRoot := filepath.Clean(filepath.Join("..", ".."))
	for _, script := range []string{
		"check-meshx-runtime-topology.sh",
		"check-meshx-runtime-topology-test.sh",
	} {
		path := filepath.Join(repositoryRoot, "guardrails", "architecture", script)
		output, err := exec.Command("bash", path).CombinedOutput()
		require.NoError(t, err, "%s:\n%s", script, output)
	}
}
