Skip to content

Commit f823b9a

Browse files
committed
ci: start the archiving browser through compose so its service is covered
1 parent e814587 commit f823b9a

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
# Harbor archives with a real browser and will not save a page it cannot
3333
# archive, so the suite needs one. Built from the repository rather than pulled,
3434
# for the same reason the image is ours: the flags are visible here.
35-
- name: build and start the archiving browser
36-
run: |
37-
docker build -t harbor-chromium:ci environment/chromium
38-
docker run -d --name harbor-chromium -p 9222:9222 --shm-size=512m harbor-chromium:ci
39-
for i in $(seq 1 30); do
40-
if curl -fsS -o /dev/null http://127.0.0.1:9222/json/version; then break; fi
41-
sleep 1
42-
done
43-
curl -fsS http://127.0.0.1:9222/json/version
35+
# Started the way a developer starts it, so this covers the compose service and
36+
# its healthcheck as well as the image — none of which anything else exercises,
37+
# since the tests get their PostgreSQL from Testcontainers rather than compose.
38+
# --wait means the step only returns once the browser reports healthy.
39+
- name: start the archiving browser
40+
run: ./run.sh browser up
41+
42+
- name: check the browser answers
43+
run: curl -fsS http://127.0.0.1:9222/json/version
4444

4545
- name: maven verify
4646
run: |

‎run.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ task_db() {
115115
task_browser() {
116116
local action="${1:-up}"
117117
case "${action}" in
118-
up) compose up -d --build chromium \
118+
up) compose up -d --build --wait chromium \
119119
&& echo "Chromium is up on 9222; set HARBOR_BROWSER_URL=http://localhost:9222." ;;
120120
down) compose stop chromium && echo "Chromium stopped." ;;
121121
logs) compose logs -f chromium ;;

0 commit comments

Comments
 (0)