mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
test: bring the test suite up to date, and let it run on Windows
The smoke, features, account and qol tests had fallen behind the server
and failed before reaching their end. Each now checks what the server
does on purpose today:
- harness: the chat filter messages the server sends unasked ("xfl"
after every login, "xfa" on the first room) are set aside like "zs".
- smoke: a banned account's sign-in is refused with "account_banned", so
the login-choices check uses a fresh account instead of the banned Carol.
- features: a shop's name comes from its room file, read the first time
anyone goes in (the first visitor sees a name made from the path). A
scout goes in first until the file is read, so the check no longer
depends on what an earlier run left in cache/.
- account: a deleted account's name is held for NAME_HELD_DAYS, so taking
it again right away is "username_taken".
- qol: the commands page sets what to type in italics.
And on Windows: withServer waits for the server process to exit before
removing its data directory, and retries; the database stays locked until
the process is gone, and the cleanup's EPERM hid the test's own result.
All seven test files pass (smoke, features, account, qol, buddygames,
restored, and staff in the next commit).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
edca7bf790
commit
63dc43ebb3
5 files changed
+46
-9
No files matched your search
+10
-1
@@ -100,6 +100,11 @@ class GameClient {
|
||||
this.varUpdates.push(fields);
|
||||
continue;
|
||||
}
|
||||
// the chat filter settings ("xfl", after every login) and the one-time
|
||||
// question which filter to use ("xfa", on the first room) come unasked.
|
||||
if ((fields[0] === "xfl" || fields[0] === "xfa") && cmd !== fields[0]) {
|
||||
continue;
|
||||
}
|
||||
if (this.unasked(fields)) {
|
||||
continue;
|
||||
}
|
||||
@@ -165,8 +170,12 @@ const withServer = async (name, httpPort, gamePort, run) => {
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
// on Windows the database stays locked until the process has gone, so
|
||||
// wait for it before throwing its files away.
|
||||
const exited = server.exitCode !== null ? Promise.resolve() : new Promise(resolve => server.once("exit", resolve));
|
||||
server.kill();
|
||||
fs.rmSync(dataDir, {recursive: true, force: true});
|
||||
await exited;
|
||||
fs.rmSync(dataDir, {recursive: true, force: true, maxRetries: 10, retryDelay: 200});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user