From 6b0a5918c2705ee5dbcdc7353a3b34a2ba1b510e Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 5 Dec 2024 11:20:13 -0500 Subject: [PATCH] sanity-check: run in a git worktree Also, check film query cli command. --- scripts/sanity-check.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/sanity-check.sh b/scripts/sanity-check.sh index fa88854..9d1ce3d 100755 --- a/scripts/sanity-check.sh +++ b/scripts/sanity-check.sh @@ -17,6 +17,11 @@ StringContains() { DIRECTORS_FILE=directors.csv +git worktree add ../sanity-check-env +trap "git worktree remove ../sanity-check-env" EXIT + +cd ../sanity-check-env + # create empty database alembic upgrade head @@ -30,6 +35,7 @@ cleanup # start webapp webapp & WEBAPP_PID=$! +trap 'kill $WEBAPP_PID; git worktree remove ../sanity-check-env' EXIT sleep 5 # check that it is running and returns some data @@ -43,5 +49,9 @@ out=$(lcli directors get) StringContains "$out" "Maryam Touzani" StringContains "$out" "Štefan Uher" -# stop webapp -kill $WEBAPP_PID +# TODO: support structured output for cli, then use it to extract values +out=$(lcli films query --limit 1 --genre drama --offer criterionchannel) +StringContains "$out" "criterionchannel" +StringContains "$out" "drama" +StringContains "$out" ">>>" +StringContains "$out" "⌛: " || exit 1