Fix browser UI tests: Enable anonymous access for mosquitto 2 (#994)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
This commit is contained in:
5
.github/copilot-instructions.md
vendored
5
.github/copilot-instructions.md
vendored
@@ -19,8 +19,11 @@
|
|||||||
- `yarn test:demo-video` - UI recording (requires Xvfb, mosquitto, tmux, ffmpeg)
|
- `yarn test:demo-video` - UI recording (requires Xvfb, mosquitto, tmux, ffmpeg)
|
||||||
- `yarn test:mcp` - Model Context Protocol tests
|
- `yarn test:mcp` - Model Context Protocol tests
|
||||||
- `yarn test:all` - All tests (unit + demo-video)
|
- `yarn test:all` - All tests (unit + demo-video)
|
||||||
|
- `./scripts/runBrowserTests.sh` - Browser mode UI tests (requires mosquitto service)
|
||||||
|
|
||||||
**CI jobs:** `test`, `ui-tests`, `demo-video`, `test-browser`
|
**CI jobs:** `test`, `ui-tests`, `demo-video`, `test-browser`, `browser-ui-tests`
|
||||||
|
|
||||||
|
**Important:** Browser UI tests require MQTT broker. In CI, GitHub Actions health checks ensure the mosquitto service is ready before tests run.
|
||||||
|
|
||||||
## Browser Mode
|
## Browser Mode
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/docker-browser.yml
vendored
2
.github/workflows/docker-browser.yml
vendored
@@ -45,6 +45,8 @@ jobs:
|
|||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
|
--entrypoint sh
|
||||||
|
cmd: -c "mkdir -p /mosquitto/config && echo 'listener 1883' > /mosquitto/config/mosquitto.conf && echo 'allow_anonymous true' >> /mosquitto/config/mosquitto.conf && exec mosquitto -c /mosquitto/config/mosquitto.conf"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
26
.github/workflows/tests.yml
vendored
26
.github/workflows/tests.yml
vendored
@@ -31,20 +31,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TESTS_MQTT_BROKER_HOST: localhost
|
TESTS_MQTT_BROKER_HOST: localhost
|
||||||
TESTS_MQTT_BROKER_PORT: 1883
|
TESTS_MQTT_BROKER_PORT: 1883
|
||||||
services:
|
|
||||||
mosquitto:
|
|
||||||
image: eclipse-mosquitto:2
|
|
||||||
ports:
|
|
||||||
- 1883:1883
|
|
||||||
options: >-
|
|
||||||
--health-cmd "mosquitto_sub -t '$SYS/#' -C 1"
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Start mosquitto
|
||||||
|
run: mosquitto -c /etc/mosquitto/conf.d/default.conf -d
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: yarn install --frozen-lockfile
|
run: yarn install --frozen-lockfile
|
||||||
- name: Build Browser Mode
|
- name: Build Browser Mode
|
||||||
@@ -71,20 +63,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TESTS_MQTT_BROKER_HOST: localhost
|
TESTS_MQTT_BROKER_HOST: localhost
|
||||||
TESTS_MQTT_BROKER_PORT: 1883
|
TESTS_MQTT_BROKER_PORT: 1883
|
||||||
services:
|
|
||||||
mosquitto:
|
|
||||||
image: eclipse-mosquitto:2
|
|
||||||
ports:
|
|
||||||
- 1883:1883
|
|
||||||
options: >-
|
|
||||||
--health-cmd "mosquitto_sub -t '$SYS/#' -C 1"
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Start mosquitto
|
||||||
|
run: mosquitto -c /etc/mosquitto/conf.d/default.conf -d
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: yarn install --frozen-lockfile
|
run: yarn install --frozen-lockfile
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -200,6 +184,8 @@ jobs:
|
|||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
|
--entrypoint sh
|
||||||
|
cmd: -c "mkdir -p /mosquitto/config && echo 'listener 1883' > /mosquitto/config/mosquitto.conf && echo 'allow_anonymous true' >> /mosquitto/config/mosquitto.conf && exec mosquitto -c /mosquitto/config/mosquitto.conf"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ ENV LANG en_US.UTF-8
|
|||||||
ENV LANGUAGE en_US:en
|
ENV LANGUAGE en_US:en
|
||||||
ENV LC_ALL en_US.UTF-8
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
|
# Configure mosquitto for anonymous access (required for tests)
|
||||||
|
RUN mkdir -p /etc/mosquitto/conf.d && \
|
||||||
|
echo "listener 1883" > /etc/mosquitto/conf.d/default.conf && \
|
||||||
|
echo "allow_anonymous true" >> /etc/mosquitto/conf.d/default.conf && \
|
||||||
|
echo "persistence false" >> /etc/mosquitto/conf.d/default.conf
|
||||||
|
|
||||||
# Install Playwright and browsers
|
# Install Playwright and browsers
|
||||||
# This ensures Playwright browsers are pre-installed in the container
|
# This ensures Playwright browsers are pre-installed in the container
|
||||||
RUN npm install -g playwright@1.57.0 && \
|
RUN npm install -g playwright@1.57.0 && \
|
||||||
|
|||||||
Reference in New Issue
Block a user