package config import ( "errors" "os" "path/filepath" "testing" ) func TestDeploymentHasOneCanonicalDirectory(t *testing.T) { root := filepath.Join("..", "..") if _, err := os.Stat(filepath.Join(root, "deploy")); !errors.Is(err, os.ErrNotExist) { t.Fatalf("obsolete deploy directory must not remain: %v", err) } for _, path := range []string{"README.md", "build-package.sh", "install.sh", "versions.lock.json", "cell/install-asterisk-user.sh", "test/nonprod-call-evidence.sh", "test/README.md", "systemd/sip-go-agent-agent.service", "systemd/sip-go-agent-dispatcher.service", "config/agent-endpoints.example.json"} { info, err := os.Stat(filepath.Join(root, "deploys", path)) if err != nil { t.Errorf("canonical deployment entry %s: %v", path, err) continue } if !info.Mode().IsRegular() { t.Errorf("deployment entry %s is not a regular file", path) } } for _, path := range []string{"config/dispatcher.json.example", "config/static-cell-artifact-v2.json", "config/static-cell-runtime-v1.json", "test/ai-dental-meiba-v1.json", "cell/install-asterisk-native.sh", "cell/asterisk.service"} { if _, err := os.Lstat(filepath.Join(root, "deploys", path)); !errors.Is(err, os.ErrNotExist) { t.Errorf("retired deployment example %s still active: %v", path, err) } } }