-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to filter scenarios and watch Backstop runs as they execute #354
Changes from 10 commits
df65fb7
6f41072
0ad6b95
f77ddeb
51325f7
2c0c67a
06c8c06
238ecb2
0e17345
5e3eebf
e877234
8a33dd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,20 @@ services: | |
retries: 20 | ||
networks: | ||
- pixel_network | ||
novnc: | ||
profiles: | ||
- manual | ||
build: novnc | ||
environment: | ||
- DISPLAY_WIDTH=1280 | ||
- DISPLAY_HEIGHT=1024 | ||
networks: | ||
- pixel_network | ||
ports: | ||
- 8088:8088 | ||
visual-regression: | ||
profiles: | ||
- manual | ||
init: true | ||
build: | ||
context: . | ||
|
@@ -73,6 +86,8 @@ services: | |
working_dir: /pixel | ||
env_file: | ||
- .env | ||
environment: | ||
- DISPLAY=novnc:0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a reminder, this line makes the magic happen It causes the visual-regression container to use the novnc container as its display The Backstop process (including Chrome) still runs in the visual-regression container, but the display window for Chrome appears on the novnc desktop We then can see the novnc container's desktop because the novnc program lets make a vnc connection from a any modern browser, in this case most frequently from the host The novnc container's desktop is using xfce4 atop an xvfb virtual frame buffer websockify lets the host connect to the novnc container's novnc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
volumes: | ||
- ./context.json:/pixel/context.json | ||
- ./viewports.js:/pixel/viewports.js | ||
|
@@ -86,6 +101,8 @@ services: | |
networks: | ||
- pixel_network | ||
a11y-regression: | ||
profiles: | ||
- manual | ||
init: true | ||
build: | ||
context: . | ||
|
@@ -95,6 +112,8 @@ services: | |
working_dir: /pixel | ||
env_file: | ||
- .env | ||
environment: | ||
- DISPLAY=novnc:0 | ||
volumes: | ||
- ./context.json:/pixel/context.json | ||
- ./viewports.js:/pixel/viewports.js | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM alpine | ||
|
||
RUN set -ex; \ | ||
apk add --no-cache \ | ||
xfce4 \ | ||
novnc \ | ||
supervisor \ | ||
x11vnc \ | ||
xvfb \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
ENV HOME=/root \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US.UTF-8 \ | ||
LC_ALL=C.UTF-8 \ | ||
DISPLAY=:0.0 \ | ||
DISPLAY_WIDTH=1280 \ | ||
DISPLAY_HEIGHT=1024 | ||
|
||
COPY . /app | ||
COPY background.svg /usr/share/backgrounds/xfce/xfce-shapes.svg | ||
|
||
CMD ["/app/entrypoint.sh"] | ||
EXPOSE 8088 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[program:xfce4] | ||
command=startxfce4 | ||
autorestart=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[program:websockify] | ||
command=websockify --web /usr/share/novnc 8088 localhost:5900 | ||
autorestart=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[program:x11vnc] | ||
command=x11vnc -forever -shared | ||
autorestart=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[program:xvfb] | ||
command=Xvfb :0 -screen 0 "%(ENV_DISPLAY_WIDTH)s"x"%(ENV_DISPLAY_HEIGHT)s"x24 -listen tcp -ac | ||
autorestart=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
if docker container ls --format '{{.Names}}' | grep -q "pixel-novnc-1"; then | ||
echo "The pixel-novnc-1 container is already running." | ||
else | ||
docker compose up --no-deps --detach novnc | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
exec supervisord -c /app/supervisord.conf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
URL="http://localhost:8088/vnc_lite.html?autoconnect=true" | ||
|
||
open "$URL" 2>/dev/null || { | ||
printf "\n\033[0;32mThe 'open' command is not available\033[0m\n" | ||
printf "\n\033[0;33mOpen the following URL in your web browser to watch BackstopJS do screen captures inside its docker container:\033[0m\n" | ||
printf "\n\033[1;33m%s\033[0m\n\n" "$URL" | ||
sleep 5 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[include] | ||
files = /app/conf.d/*.conf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Start docker containers | ||
docker compose --progress=plain --project-directory . -f ./docker-compose.yml up -d | ||
docker compose --progress=plain --project-directory . -f ./docker-compose.yml up -d | ||
|
||
# Start novnc container if needed | ||
if [ "${WATCH_MODE}" = "1" ]; then | ||
./novnc/ensure-novnc-container-up.sh | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering changing
FILTER
toSCENARIO_FILTER
to be explicit...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done