Compare commits

..

4 commits

Author SHA1 Message Date
56f1591b6e
Merge branch 'boot-test-workflow'
All checks were successful
Make sure the server is actually able to start / prettier (push) Successful in 19s
Run node --check on everything / node-check (push) Successful in 4s
Check project using prettier / prettier (push) Successful in 9s
This will hopefully make sure that the server actually starts before
giving that coveted "tests passed" status.
2024-05-24 18:07:01 +00:00
12cceb99cd
Handle the listen socket not existing correctly
All checks were successful
Run node --check on everything / node-check (push) Successful in 7s
Check project using prettier / prettier (push) Successful in 19s
2024-05-24 18:06:33 +00:00
c05b6f1a8a
Fix a bug 2024-05-24 18:04:26 +00:00
527880457c
Add a test that makes sure that the server can start successfully 2024-05-24 18:01:01 +00:00
2 changed files with 25 additions and 2 deletions

View file

@ -0,0 +1,15 @@
name: "Make sure the server is actually able to start"
author: "9pfs@amcforum.wiki (h @ nest)"
on:
push:
branches:
- main
jobs:
prettier:
runs-on: docker
steps:
- uses: actions/checkout@v3
- id: dependencies
run: NODE_ENV=development npm ci
- id: boot-test
run: TEST_MODE=boot LISTEN_PATH=/tmp/webserver.sock node index.js

View file

@ -85,6 +85,14 @@ const listen_path =
? "/run/user/2123/countify/webserver.sock" ? "/run/user/2123/countify/webserver.sock"
: "/run/user/2123/countify-dev.sock"; : "/run/user/2123/countify-dev.sock";
if (listen_path[0] == "/") { if (listen_path[0] == "/") {
await unlink(listen_path); try {
await unlink(listen_path);
} catch (e) {}
}
const listener = app.listen(listen_path);
if (process.env?.TEST_MODE == "boot") {
console.log("Server started successfully.");
// We've successfully started. Time to shut down.
listener.close();
process.exit(0);
} }
app.listen(listen_path);