diff --git a/Makefile b/Makefile index 8543f6c..05963fb 100644 --- a/Makefile +++ b/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 diff --git a/tests/default.smoke.js b/tests/default.smoke.js new file mode 100644 index 0000000..d368951 --- /dev/null +++ b/tests/default.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 }); +}