Skip to content

Commit

Permalink
sanity-check: run in a git worktree
Browse files Browse the repository at this point in the history
Also, check film query cli command.
  • Loading branch information
booxter committed Dec 5, 2024
1 parent a27393d commit 6b0a591
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/sanity-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

0 comments on commit 6b0a591

Please sign in to comment.