diff --git a/requests_test.go b/requests_test.go index e3b8dd3..c2d0fad 100644 --- a/requests_test.go +++ b/requests_test.go @@ -108,7 +108,8 @@ func TestRequest(t *testing.T) { } defer ns.Shutdown() - tempdir := t.TempDir() + // tempdir := t.TempDir() + tempdir := "tmp" srv, conf := newServerForTesting(t, "127.0.0.1:42222", tempdir) srv.Start() defer srv.Stop() @@ -126,6 +127,22 @@ func TestRequest(t *testing.T) { } tests := []test{ + { + info: "REQHello test", + message: Message{ + ToNode: "errorCentral", + FromNode: "errorCentral", + Method: REQErrorLog, + MethodArgs: []string{}, + MethodTimeout: 5, + Data: []byte("error data"), + // ReplyMethod: REQTest, + Directory: "error_log", + FileName: "error.results", + }, want: []byte("error data"), + containsOrEquals: fileContains, + viaSocketOrCh: viaCh, + }, { info: "REQHello test", message: Message{ diff --git a/steward_test.go b/steward_test.go index 7dbe17b..8aa3da0 100644 --- a/steward_test.go +++ b/steward_test.go @@ -58,7 +58,6 @@ func TestStewardServer(t *testing.T) { // Specify all the test funcs to run in the slice. funcs := []testFunc{ - checkREQErrorLogTest, checkREQTailFileTest, checkErrorKernelMalformedJSONtest, checkMetricValuesTest, @@ -77,26 +76,6 @@ func TestStewardServer(t *testing.T) { // Check REQ types // ---------------------------------------------------------------------------- -// Check the error logger type. -func checkREQErrorLogTest(stewardServer *server, conf *Configuration, t *testing.T, tempDir string) error { - m := Message{ - ToNode: "somenode", - } - - p := newProcess(stewardServer.ctx, stewardServer, Subject{}, processKindSubscriber, nil) - - stewardServer.errorKernel.errSend(p, m, fmt.Errorf("some error")) - - resultFile := filepath.Join(conf.SubscribersDataFolder, "errorLog", "errorCentral", "error.log") - _, err := findStringInFileTest("some error", resultFile, conf, t) - if err != nil { - return fmt.Errorf(" \U0001F631 [FAILED] : checkREQErrorLogTest: %v", err) - } - - t.Logf(" \U0001f600 [SUCCESS] : checkREQErrorLogTest\n") - return nil -} - // Check the tailing of files type. func checkREQTailFileTest(stewardServer *server, conf *Configuration, t *testing.T, tmpDir string) error { // Create a file with some content.