Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create edge-monitor-server and test info/login endpoints #2

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

paullinator
Copy link
Member

@paullinator paullinator commented Nov 20, 2023


@paullinator paullinator force-pushed the paul/addTests branch 2 times, most recently from 99cdc37 to 6296fec Compare November 21, 2023 18:43
.github/workflows/monitor-server-ci.yml Outdated Show resolved Hide resolved
src/db/dbDummyRolling.ts Show resolved Hide resolved
src/db/dbDummyRolling.ts Outdated Show resolved Hide resolved
src/db/dbSettings.ts Show resolved Hide resolved
message: string
}

export const statusCodes: { [key: string]: StatusCode } = {
Copy link

@swansontec swansontec Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This structure is very login-server specific. I wouldn't replicate it on any other servers - we are only doing things this way because we have to remain compatible with the old Python code.

For instance, using integers for the status codes is pretty weird. We should use string enums, since those are easier to understand and read. Also, mixing the HTTP status code with the Edge status code leads to lots of weirdness.

I suggest just deleting the statusResponse function and it's matching statusCodes structure. This repo doesn't really use it in many places. You can hard-code { httpStatus: 404 } in the missingRoute function, and there should be no obsoleteRoute, since this is a brand-new server.

For the health-check route and dummy route, maybe define a simple successResponse function that returns { httpStatus: 200 }.

package.json Outdated Show resolved Hide resolved
src/util/testing.ts Show resolved Hide resolved
src/util/utils.ts Show resolved Hide resolved
fixtures/infoServer.json Show resolved Hide resolved
Copy link

@swansontec swansontec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the $default-branch syntax error and the archive start date.

Used edge-login-server as a template to create edge-dummy-server.

Used edge-dummy-server as template for this repo
Adds ability to test arbitrary GET/POST calls with url settings entirely configured on the DB.
Each fixture doc can specify the frequency that it is run in the engine loop
@paullinator paullinator merged commit 0907f17 into master Aug 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants