diff --git a/tests/helper/task.go b/tests/helper/task.go index 99cd69c..e542044 100644 --- a/tests/helper/task.go +++ b/tests/helper/task.go @@ -19,7 +19,7 @@ func init() { switch runtime.GOOS { case "windows": HostsFilePath = "$env:windir/System32/drivers/etc/hosts" - NoFileErrorMessage = "Cannot find path \\r\\n'.+%s' because it does not exist." + NoFileErrorMessage = "Cannot find path (\\r\\n)*'.+%s' because (\\r\\n)*it (\\r\\n)*does (\\r\\n)*not (\\r\\n)*exist." case "linux": HostsFilePath = "/etc/hosts" NoFileErrorMessage = "%s: No such file or directory" diff --git a/tests/worker/task_logs_test.go b/tests/worker/task_logs_test.go index 0c92d0a..30c7081 100644 --- a/tests/worker/task_logs_test.go +++ b/tests/worker/task_logs_test.go @@ -32,7 +32,7 @@ func TestTaskLogs__PrintFile(t *testing.T) { name: "print-non-existing-file", path: "non-existing-file.txt", responseStatus: http.StatusInternalServerError, - responseBody: "", + responseBody: "Error when executing the task: exit status 1", stdoutRegexp: fmt.Sprintf(helper.NoFileErrorMessage, "non-existing-file.txt"), }, } @@ -52,7 +52,7 @@ func TestTaskLogs__PrintFile(t *testing.T) { }) assert.Equal(t, tc.responseStatus, responseRecorder.Code) - assert.Equal(t, tc.responseBody, tc.responseBody) + assert.Equal(t, tc.responseBody, responseRecorder.Body.String()) assert.Regexp(t, tc.stdoutRegexp, stdout) }) }