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

Add test coverage for WebSocket messages #351

Merged
merged 5 commits into from
Dec 2, 2023
Merged

Conversation

iamlogand
Copy link
Owner

@iamlogand iamlogand commented Dec 2, 2023

Add test coverage for the WebSocket messages that are generated when actions are processed. The new coverage revealed the cause of #347 was in the frontend. This PR includes the fix.

Also, add VS Code integration for Django tests, which enables tests to be debugged:

image

Shift responsibility for sending WebSocket messages from each action function to the submit action view, because it is common behavior so shouldn't be repeated. This will also make it easier to setup testing for WebSocket messages.
Enable test running and debugging through VS Code, using pytest. Also remove Django Debug Toolbar because it was causing issues when running the tests through VS Code, and I haven't really used it since I added it.
@iamlogand iamlogand added the testing Automated test coverage label Dec 2, 2023
Improve the Senator admin page to improve developer experience.
Add coverage for WebSocket messages in the mortality phase tests. The test only checks that the correct number of messages are produced, not what the messages contain, which isn't ideal but it's better than nothing.
@iamlogand iamlogand marked this pull request as ready for review December 2, 2023 14:20
Allow the frontend to notice Faction updates in WebSocket messages. It should have been able to do this already, but it had been missed. This change fixes the bug where faction rank changes weren't showing up in the frontend unless the page was refreshed.
@iamlogand iamlogand added the bug Bug or bug fix label Dec 2, 2023
@iamlogand iamlogand linked an issue Dec 2, 2023 that may be closed by this pull request
@iamlogand iamlogand merged commit 06c00cb into main Dec 2, 2023
2 checks passed
@iamlogand iamlogand deleted the tests/websocket-messages branch December 2, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or bug fix testing Automated test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to process WebSocket messages on faction rank changes
1 participant