This repository has been archived on 2026-11-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
node-lookup/cmd/pblastreport/main_test.go
T
unkin-agent 1c0e47167c
ci / goreleaser-check (push) Has been cancelled
ci / release-snapshot (push) Failing after 12m18s
ci / go (push) Failing after 12m20s
ci / actions (push) Failing after 12m20s
ci / ci (push) Failing after 12m21s
Prepare for GitHub migration (#24)
Moves node-lookup to IUCLabs/node-lookup on GitHub; it must carry no internal hostnames or Woodpecker release.

- Loads PuppetDB, Puppetboard and domain from config (flags > env > ~/.config > /etc) for all 3 tools; errors name the config paths
- Ships packaging/config.example.yaml as an RPM doc
- Rewrites .goreleaser.yaml: raw binaries + amd64 RPM with completions, signed checksums
- Adds GitHub CI/release workflows, CODEOWNERS, zizmor config, README
- Makes patch/minor/major draft a GitHub release; make rpm runs a goreleaser snapshot
- Removes the Woodpecker release pipeline, nfpm.yaml and build-rpm.sh

Reviewed-on: #24
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-26 23:09:43 +11:00

25 lines
683 B
Go

package main
import (
"path/filepath"
"strings"
"testing"
"node-lookup/internal/puppet"
)
func TestExecute_MissingConfigNamesBothKeys(t *testing.T) {
dir := t.TempDir()
t.Setenv("XDG_CONFIG_HOME", dir)
t.Setenv("NODE_LOOKUP_URL", "")
t.Setenv("NODE_LOOKUP_PUPPETBOARD_URL", "")
old := puppet.SystemConfigPath
puppet.SystemConfigPath = filepath.Join(dir, "etc-config.yaml")
t.Cleanup(func() { puppet.SystemConfigPath = old })
err := execute([]string{"host1"})
if err == nil || !strings.Contains(err.Error(), "puppetdb_url") || !strings.Contains(err.Error(), "puppetboard_url") {
t.Fatalf("expected missing puppetdb_url and puppetboard_url error, got %v", err)
}
}