Skip to content

Commit

Permalink
fix: removed useless logging config for config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
equals215 committed Apr 16, 2024
1 parent 0044565 commit 5275673
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions config/agent_live_change_test.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
package config

import (
"bytes"
"testing"

log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
easy "github.com/t-tomalak/logrus-easy-formatter"
)

func TestAgentSetServerAddress(t *testing.T) {
var logOutput bytes.Buffer
log.SetLevel(log.InfoLevel)
log.SetOutput(&logOutput)
log.SetFormatter(&easy.Formatter{
LogFormat: "%msg%",
})

// Test case 1: Agent is nil
Agent = nil
err := AgentSetServerAddress("http://localhost:8080")
Expand Down Expand Up @@ -45,13 +35,6 @@ func TestAgentSetServerAddress(t *testing.T) {
}

func TestAgentSetAuthToken(t *testing.T) {
var logOutput bytes.Buffer
log.SetLevel(log.InfoLevel)
log.SetOutput(&logOutput)
log.SetFormatter(&easy.Formatter{
LogFormat: "%msg%",
})

// Test case 1: Agent is nil
Agent = nil
err := AgentSetAuthToken("token123")
Expand All @@ -74,13 +57,6 @@ func TestAgentSetAuthToken(t *testing.T) {
}

func TestAgentSetMachineName(t *testing.T) {
var logOutput bytes.Buffer
log.SetLevel(log.InfoLevel)
log.SetOutput(&logOutput)
log.SetFormatter(&easy.Formatter{
LogFormat: "%msg%",
})

// Test case 1: Agent is nil
Agent = nil
err := AgentSetMachineName("machine1")
Expand Down

0 comments on commit 5275673

Please sign in to comment.