1c0e47167c
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>
25 lines
683 B
Go
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)
|
|
}
|
|
}
|