Skip to content

Commit

Permalink
fix: test_image.sh (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbellone authored Dec 8, 2022
1 parent c5e497c commit 3caa65b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions scripts/test_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ done
logs=$(docker logs renderscript_test 2>&1)
echo $logs

if echo $logs | grep -q '"svc":"brws","msg":"Ready"'; then
echo "Browser ready"
else
echo "Browser not ready"
exit 1
fi

curl --silent --request POST \
--url http://localhost:3000/render \
--header 'Content-Type: application/json' \
Expand All @@ -34,17 +41,12 @@ curl --silent --request POST \
logs=$(docker logs renderscript_test 2>&1)
echo $logs

launched=$(echo $logs | grep '"svc":"brws","msg":"Ready"')
if [ -z "$launched" ]; then
echo "Not ready"
exit 1
fi

rendered=$(echo $logs | grep '"msg":"Done","data":')
if [ -z "$rendered" ]; then
if echo $logs | grep -q '"msg":"Done","data":'; then
echo "Rendered"
else
echo "Not rendered"
exit 1
fi

echo "Ready"
echo "Image OK"
docker stop renderscript_test && docker rm renderscript_test
2 changes: 1 addition & 1 deletion src/lib/browser/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Browser {
});

this.#ready = true;
log.info('Browser ready', { id: this.#id, browser: this.#engine });
log.info('Ready', { id: this.#id, browser: this.#engine });
}

async stop(): Promise<void> {
Expand Down

0 comments on commit 3caa65b

Please sign in to comment.