Skip to content

Commit

Permalink
rename windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamor1 committed Aug 28, 2020
1 parent b0bdecf commit f9814be
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions agent/logger/log_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestLogfmtFormat(t *testing.T) {
func TestLogfmtFormatWindows(t *testing.T) {
logfmt := logfmtFormatter("")
out := logfmt("This is my log message", seelog.InfoLvl, &LogContextMock{})
s, ok := out.(string)
Expand All @@ -33,15 +33,15 @@ func TestLogfmtFormat(t *testing.T) {
`, s)
}

func TestJSONFormat(t *testing.T) {
func TestJSONFormatWindows(t *testing.T) {
jsonF := jsonFormatter("")
out := jsonF("This is my log message", seelog.InfoLvl, &LogContextMock{})
s, ok := out.(string)
require.True(t, ok)
require.JSONEq(t, `{"level": "info", "time": "2018-10-01T01:02:03Z", "msg": "This is my log message", "module": "mytestmodule.go"}`, s)
}

func TestLogfmtFormat_debug(t *testing.T) {
func TestLogfmtFormatWindows_debug(t *testing.T) {
logfmt := logfmtFormatter("")
out := logfmt("This is my log message", seelog.DebugLvl, &LogContextMock{})
s, ok := out.(string)
Expand All @@ -50,15 +50,15 @@ func TestLogfmtFormat_debug(t *testing.T) {
`, s)
}

func TestJSONFormat_debug(t *testing.T) {
func TestJSONFormatWindows_debug(t *testing.T) {
jsonF := jsonFormatter("")
out := jsonF("This is my log message", seelog.DebugLvl, &LogContextMock{})
s, ok := out.(string)
require.True(t, ok)
require.JSONEq(t, `{"level": "debug", "time": "2018-10-01T01:02:03Z", "msg": "This is my log message", "module": "mytestmodule.go"}`, s)
}

func TestSeelogConfig_Default(t *testing.T) {
func TestSeelogConfigWindows_Default(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestSeelogConfig_Default(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_DebugLevel(t *testing.T) {
func TestSeelogConfigWindows_DebugLevel(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: "debug",
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestSeelogConfig_DebugLevel(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_SizeRollover(t *testing.T) {
func TestSeelogConfigWindows_SizeRollover(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestSeelogConfig_SizeRollover(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_SizeRolloverFileSizeChange(t *testing.T) {
func TestSeelogConfigWindows_SizeRolloverFileSizeChange(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestSeelogConfig_SizeRolloverFileSizeChange(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_SizeRolloverRollCountChange(t *testing.T) {
func TestSeelogConfigWindows_SizeRolloverRollCountChange(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -213,7 +213,7 @@ func TestSeelogConfig_SizeRolloverRollCountChange(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_JSONOutput(t *testing.T) {
func TestSeelogConfigWindows_JSONOutput(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -244,7 +244,7 @@ func TestSeelogConfig_JSONOutput(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_NoOnInstanceLog(t *testing.T) {
func TestSeelogConfigWindows_NoOnInstanceLog(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: DEFAULT_LOGLEVEL,
Expand Down Expand Up @@ -275,7 +275,7 @@ func TestSeelogConfig_NoOnInstanceLog(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_DifferentLevels(t *testing.T) {
func TestSeelogConfigWindows_DifferentLevels(t *testing.T) {
Config = &logConfig{
logfile: "foo.log",
driverLevel: "warn",
Expand Down Expand Up @@ -306,7 +306,7 @@ func TestSeelogConfig_DifferentLevels(t *testing.T) {
</seelog>`, c)
}

func TestSeelogConfig_FileLevelDefault(t *testing.T) {
func TestSeelogConfigWindows_FileLevelDefault(t *testing.T) {
os.Setenv(LOG_DRIVER_ENV_VAR, "awslogs")
defer os.Unsetenv(LOG_DRIVER_ENV_VAR)

Expand Down

0 comments on commit f9814be

Please sign in to comment.