mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-20 04:14:32 +09:00
1 parent
cb4ccd97c2
commit
3e12fa9d39
9 files changed
+34
-195
No files matched your search
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -149,9 +148,6 @@ func writeFile(t *testing.T, dir, name, content string) string {
|
||||
func runCheck(t *testing.T, c *cobra.Command, file string) (string, error) {
|
||||
t.Helper()
|
||||
|
||||
viper.Reset()
|
||||
t.Cleanup(viper.Reset)
|
||||
|
||||
cmd := &cobra.Command{}
|
||||
cmd.Flags().String("file", file, "")
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/juanfont/headscale/hscontrol/types"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -349,9 +348,6 @@ func TestOfflineSetPolicyRunsTests(t *testing.T) {
|
||||
},
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
viper.Reset()
|
||||
t.Cleanup(viper.Reset)
|
||||
|
||||
dir := t.TempDir()
|
||||
configPath := filepath.Join(dir, "config.yaml")
|
||||
config := fmt.Sprintf(`server_url: https://headscale.example.com
|
||||
@@ -456,8 +452,6 @@ func TestLoadConfig(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
viper.Reset()
|
||||
t.Cleanup(viper.Reset)
|
||||
t.Setenv("HEADSCALE_CONFIG", tt.env)
|
||||
|
||||
old := cfgFile
|
||||
|
||||
Reference in new issue
Block a user