Compare commits

...

2 Commits

Author SHA1 Message Date
Asher 26c763485b
Update JSON parse error matcher
Looks like this text changed?
2024-06-21 09:52:42 -08:00
Asher d431c9cd9d
Fix log file path
The first argument is a file name, not a path.  When the log gets
rotated it prepends the date which ends up creating a path in the
current working directory.
2024-06-21 09:47:44 -08:00
2 changed files with 4 additions and 3 deletions

View File

@ -248,9 +248,10 @@ export class ParentProcess extends Process {
const opts = { const opts = {
size: "10M", size: "10M",
maxFiles: 10, maxFiles: 10,
path: path.join(paths.data, "coder-logs"),
} }
this.logStdoutStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stdout.log"), opts) this.logStdoutStream = rfs.createStream("code-server-stdout.log", opts)
this.logStderrStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stderr.log"), opts) this.logStderrStream = rfs.createStream("code-server-stderr.log", opts)
this.onDispose(() => this.disposeChild()) this.onDispose(() => this.disposeChild())

View File

@ -29,7 +29,7 @@ describe("settings", () => {
const settings = new SettingsProvider<CoderSettings>(pathToMockSettingsFile) const settings = new SettingsProvider<CoderSettings>(pathToMockSettingsFile)
await settings.read() await settings.read()
// This happens when we can't parse a JSON (usually error in file) // This happens when we can't parse a JSON (usually error in file)
expect(logger.warn).toHaveBeenCalledWith("Unexpected token t in JSON at position 29") expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/Unexpected token/))
}) })
}) })
describe("with invalid settings file path", () => { describe("with invalid settings file path", () => {