-
Notifications
You must be signed in to change notification settings - Fork 47
Update mock server #534
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
Update mock server #534
Conversation
result = self.env.shell.exec(python_path, | ||
'-m', 'pip', 'install', 'h11') | ||
result = self.env.shell.exec(python_path, | ||
'-m', 'pip', 'install', 'trio') | ||
result = self.env.shell.exec(python_path, | ||
'-m', 'pip', 'install', 'h2') |
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.
super trivial: we can install the deps together in one cmd.
result = self.env.shell.exec(python_path, | |
'-m', 'pip', 'install', 'h11') | |
result = self.env.shell.exec(python_path, | |
'-m', 'pip', 'install', 'trio') | |
result = self.env.shell.exec(python_path, | |
'-m', 'pip', 'install', 'h2') | |
result = self.env.shell.exec(python_path, '-m', 'pip', 'install', 'h2', 'h11', 'trio', check=True) |
tests/mock_server/README.md
Outdated
* Have the cert/key ready. The script now using `../resources/unittests.crt`, you can either just run the script within this directory, which will find the certificates and key from the related path, or you can use your own and change the code coordinately. | ||
* Run python. `python3 ./server.py`. | ||
|
||
#### Endpoints |
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.
Do we missed x-upload-test
?
Also, I think the endpoint is misleading, they are not different endpoints.
tests/test_localhost_integ.c
Outdated
const char *bytes_key = "\"bytes\": "; | ||
const char *json_str = (const char *)data->ptr; | ||
const char *bytes_pos = strstr(json_str, bytes_key); | ||
if (bytes_pos != NULL) { | ||
s_tester.num_sen_received = (uint64_t)strtoull(bytes_pos + strlen(bytes_key), NULL, 10); | ||
} |
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.
It's probably fine in test, but we are trying to not use str
directly in the codebase, we have helpers in byte_buf.h
and string.h
in common.
curl -k -v -H "x-repeat-data: 5000000" -H "x-slow-response: true" -H "x-throughput-bps: 500" https://localhost:3443/echo | ||
``` | ||
|
||
##### Any other path |
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.
Can you merge the current main? I think I just added a expect-500 to the mock server a day or two ago, we will also want to add it here
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
=======================================
Coverage 79.70% 79.70%
=======================================
Files 28 28
Lines 11865 11865
=======================================
Hits 9457 9457
Misses 2408 2408 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Issue #, if available:
Description of changes:
changes to HTTP2 mock server, added HTTP/1.1 mock server. Changed some testcases to reflect mock server changes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.