test: add smoke tests
parent
6e0ab3af49
commit
796ce8154e
3
Makefile
3
Makefile
|
|
@ -18,3 +18,6 @@ $(PRE_COMMIT_HOOK):
|
|||
poetry run pre-commit install --install-hooks
|
||||
|
||||
setup-development-environment: install-poetry $(PRE_COMMIT_HOOK)
|
||||
|
||||
test-smoke:
|
||||
k6 run tests/*.smoke.js
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
import http from "k6/http";
|
||||
import { check } from "k6";
|
||||
|
||||
export default function () {
|
||||
const payload = JSON.stringify({
|
||||
prompt: "def binarySearch(arr, left, right, x):\n mid = (left +",
|
||||
});
|
||||
const headers = { "Content-Type": "application/json" };
|
||||
const res = http.post("http://localhost:5000/v1/completions", payload, {
|
||||
headers,
|
||||
});
|
||||
check(res, { success: (r) => r.status === 200 });
|
||||
}
|
||||
Loading…
Reference in New Issue