Skip to content

Commit 9383ad2

Browse files
committed
chore-usage-lightpanda-4dj
1 parent 83e7acc commit 9383ad2

4 files changed

Lines changed: 7 additions & 36 deletions

File tree

Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
FROM jetthoughts/cimg-ruby:4.0-chrome
77

88
ENV DEBIAN_FRONTEND=noninteractive \
9-
BUNDLE_PATH=/bundle \
10-
LIGHTPANDA_DISABLE_TELEMETRY=true
9+
BUNDLE_PATH=/bundle
1110

1211
# Install system dependencies with cached apt
1312
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -42,11 +41,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
4241
swig && \
4342
sudo rm -rf /var/lib/apt/lists/*
4443

45-
# Install Lightpanda browser (experimental CDP-compatible headless browser)
46-
RUN sudo curl -L -o /usr/local/bin/lightpanda \
47-
https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \
48-
sudo chmod a+x /usr/local/bin/lightpanda
49-
5044
# Setup directories and fix font config if file exists
5145
RUN sudo mkdir -p /bundle /tmp/.X11-unix && \
5246
sudo chmod 1777 /bundle /tmp/.X11-unix && \

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -688,16 +688,6 @@ RECORD_SCREENSHOTS=1 bin/dtest
688688

689689
This skips screenshot comparisons and saves new baselines instead. Without this step, tests will fail because your local browser renders pixels differently from the previously committed baselines.
690690

691-
#### Experimental: Lightpanda browser
692-
693-
[Lightpanda](https://github.com/lightpanda-io/browser) is included as an experimental CDP-based headless browser. It can be enabled for the `cuprite` driver:
694-
695-
```bash
696-
ENABLE_LIGHTPANDA=1 bin/dtest
697-
```
698-
699-
**Note:** Lightpanda's CDP support does not yet cover viewport resizing or full execution context management, so screenshot comparison tests may fail. This is gated behind the env var until Lightpanda matures.
700-
701691
## Contributing
702692

703693
See [CONTRIBUTING.md](CONTRIBUTING.md)

bin/dtest

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export DOCKER_DEFAULT_PLATFORM=linux/amd64
77
# Define allowed environment variables to pass to Docker
88
ALLOWED_ENV_VARS=(
99
"CI" "DEBUG" "TEST_ENV" "RAILS_ENV" "RACK_ENV" "COVERAGE" "DISABLE_ROLLBACK_COMPARISON_RUNTIME_FILES"
10-
"RECORD_SCREENSHOTS" "TEST" "TESTOPTS" "SCREENSHOT_DRIVER" "ENABLE_LIGHTPANDA"
10+
"RECORD_SCREENSHOTS" "TEST" "TESTOPTS" "SCREENSHOT_DRIVER"
1111
)
1212

1313
# Build the Docker env args string
@@ -29,15 +29,7 @@ echo "Running tests..."
2929
DRIVERS=("cuprite" "selenium_chrome_headless" "selenium_headless")
3030
for driver in "${DRIVERS[@]}"; do
3131
echo "Running tests with $driver driver..."
32-
if [[ "$driver" == "cuprite" && -n "$ENABLE_LIGHTPANDA" ]]; then
33-
docker run $DOCKER_ENV_ARGS \
34-
-e CAPYBARA_DRIVER="$driver" \
35-
-e LIGHTPANDA_URL="ws://127.0.0.1:9222" \
36-
-v ${PWD}:/app -v csd-bundle-cache:/bundle --rm -t csd:test \
37-
bash -c 'lightpanda serve --host 127.0.0.1 --port 9222 & sleep 1 && bin/rake test "$@"' _ "$@" || exit 1
38-
else
39-
docker run $DOCKER_ENV_ARGS -e CAPYBARA_DRIVER="$driver" \
40-
-v ${PWD}:/app -v csd-bundle-cache:/bundle --rm -t csd:test \
41-
bin/rake test "$@" || exit 1
42-
fi
32+
docker run $DOCKER_ENV_ARGS -e CAPYBARA_DRIVER="$driver" \
33+
-v ${PWD}:/app -v csd-bundle-cache:/bundle --rm -t csd:test \
34+
bin/rake test "$@" || exit 1
4335
done

test/support/setup_capybara_drivers.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,10 @@
6969
process_timeout: ENV["CI"] ? 40 : 5,
7070
screen_size: SCREEN_SIZE,
7171
timeout: ENV["CI"] ? 40 : 5,
72-
window_size: SCREEN_SIZE
72+
window_size: SCREEN_SIZE,
73+
browser_options: CHROME_ARGS
7374
}
7475

75-
if ENV["LIGHTPANDA_URL"]
76-
cuprite_options[:url] = ENV["LIGHTPANDA_URL"]
77-
else
78-
cuprite_options[:browser_options] = CHROME_ARGS
79-
end
80-
8176
Capybara.register_driver(:cuprite) do |app|
8277
Capybara::Cuprite::Driver.new(app, **cuprite_options)
8378
end

0 commit comments

Comments
 (0)