-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Server improvements #32
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
09bd8bb
[general] cmake stuff
waleko 98ca994
[server] WIP games storage config + options parsing for server
waleko b374404
[server] minor fixes for ci
waleko d25d9ff
[ci] first basic server ci
waleko 1e7d4a2
Updated config.yml
waleko 17c097e
Fix std::move(directory) bug
petrtsv ff685d1
[ci] make basic healthcheck for server
waleko 00d09e1
[ci] make basic healthcheck for server
waleko 35ab837
Merge branch 'develop' into feature/server-improvements
waleko 548bb4a
[server] apply clangformat
waleko 0a79de3
[server] replace jsoncpp with nlohmann-json
waleko e991c8a
[ci] fix nlohmann install
waleko e2b6a3d
[server] try fix ci build
waleko 92112c5
[ci] set nlohmann minimum version
waleko 1cc21fe
[ci] set nlohmann minimum version
waleko 2989f36
[ci] try with custom docker image
waleko bfa31d9
[ci] try with custom docker image
waleko 3d72e56
Merge remote-tracking branch 'origin/develop' into feature/server-imp…
waleko 8a7d84f
[server] apply clangformat
waleko 370ced3
[server] various microimprovements and fixes
waleko a2f0fc8
[server] set minimum version for drogon
waleko 190d5b3
[client] fix cmake `QT_MAJOR_VERSION`
waleko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python3 | ||
import atexit | ||
import time | ||
|
||
import requests | ||
import subprocess | ||
import sys | ||
|
||
|
||
def check_eq(expected, actual): | ||
if expected != actual: | ||
print(f'Check failed: expected {repr(expected)}, got {repr(actual)}') | ||
sys.exit(1) | ||
|
||
|
||
def main(): | ||
_, *server_cmd = sys.argv | ||
assert server_cmd, 'Expected usage: ./server-test-health.py <command-to-run>' | ||
|
||
port = 8080 | ||
print(f'Booting server... at {server_cmd}', flush=True) | ||
|
||
server = subprocess.Popen(args=[*server_cmd, '-p', str(port)]) | ||
def kill_server(): | ||
try: | ||
server.wait(timeout=0.1) | ||
except subprocess.TimeoutExpired: | ||
print('Server terminating...', flush=True) | ||
server.kill() | ||
atexit.register(kill_server) | ||
time.sleep(2) # FIXME | ||
print('Checks starting...', flush=True) | ||
|
||
with requests.get(f'http://localhost:{port}/health') as r: | ||
check_eq(200, r.status_code) | ||
check_eq("OK", r.text) | ||
print("Health ok.") | ||
|
||
print('All ok.') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хмммммм, выглядит подозрительно знакомо, кажется, я это уже видел в лабе, хмммммм