From f04197112c1e4e664832e87c5085ca011d6e315a Mon Sep 17 00:00:00 2001 From: Brian Bockelman Date: Sun, 11 Jun 2023 15:55:52 -0500 Subject: [PATCH] WIP: Add debugging statements to understand windows failures --- config/config.go | 1 + namespaces_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config/config.go b/config/config.go index 257b31d..4bb52e4 100644 --- a/config/config.go +++ b/config/config.go @@ -44,6 +44,7 @@ type OSDFConfig struct { // func GetPreferredPrefix() string { arg0 := strings.ToUpper(path.Base(os.Args[0])) + log.Errorln("Current arg0:", arg0) underscore_idx := strings.Index(arg0, "_") if underscore_idx != -1 { return arg0[0:underscore_idx] diff --git a/namespaces_test.go b/namespaces_test.go index cd1f59b..44ddda2 100644 --- a/namespaces_test.go +++ b/namespaces_test.go @@ -2,6 +2,7 @@ package stashcp import ( "os" + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -158,6 +159,7 @@ func TestDownloadNamespaces(t *testing.T) { os.Setenv("STASH_NAMESPACE_URL", "https://topology-itb.opensciencegrid.org/stashcache/namespaces") viper.Reset() config.Init() + fmt.Printf("Prefix %s; STASH_NAMESPACE_URL: %s; config NamespaceURL: %s", config.GetPreferredPrefix(), os.Getenv("STASH_NAMESPACE_URL"), viper.GetString("NamespaceURL")) defer os.Unsetenv("STASH_NAMESPACE_URL") namespaceBytes, err := downloadNamespace() assert.NoError(t, err, "Failed to download namespaces")