-
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
Add ability to filter scenarios and watch Backstop runs as they execute #354
Conversation
Usage: WATCH_MODE=1 ./pixel reference|test
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
README.md
Outdated
|
||
To quickly restrict which scenario runs without modifying any code, you can use the `FILTER` env var: | ||
|
||
`FILTER="Sticky header with unpinned TOC" ./pixel.js reference` |
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
to SCENARIO_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
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.
+1 Works locally for me, but looks like tests need to be fixed
@bernardwang Thanks! I think I know what's happening with the tests! The https://github.com/wikimedia/pixel/blob/main/.github/workflows/push.yml action is failing even if any of the screenshot comparisons fail, which we obviously don't want. Can fix in a follow-up since it's not specific to this PR's changes |
Adds two new debugging env vars,
WATCH_MODE
andSCENARIO_FILTER
Usage
Watch mode:
Lets you watch BackstopJS as it loads pages in Chrome while it takes its screenshots
WATCH_MODE=1 ./pixel reference
Scenario filter:
Lets you easily/codelessly zero in on specific scenario(s)
SCENARIO_FILTER="Sticky header with unpinned TOC" ./pixel.js reference
Notes
Both of these should work with any Pixel command kicking off Backstop run(s)
The
novnc
container only ever starts if theWATCH_MODE
flag is used, so this shouldn't affect anything on the server