-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add test for the fastapi example to the notebook runner
- Loading branch information
1 parent
2c46184
commit 210138e
Showing
2 changed files
with
16 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env -S bash -eu -o pipefail | ||
|
||
# start the server in the background | ||
hypercorn src/examples/fastapi_example:app --bind localhost:8000 & | ||
my_pid=$! | ||
|
||
trap 'kill $my_pid' EXIT SIGINT | ||
# waiting for server startup | ||
sleep 3 | ||
curl -X GET http://localhost:8000 --fail-with-body | ||
curl -X POST http://localhost:8000/summary --fail-with-body -H "Content-Type: application/json" -d '{"chunk": "<your text to summarize here>", "language": {"iso_639_1": "en"}}' | ||
|
||
# kill happens at the end with the trap command | ||
exit 0 |
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