diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 813b5a7..8a5d644 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,8 +19,11 @@ - `yarn test:demo-video` - UI recording (requires Xvfb, mosquitto, tmux, ffmpeg) - `yarn test:mcp` - Model Context Protocol tests - `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 diff --git a/.github/workflows/docker-browser.yml b/.github/workflows/docker-browser.yml index f565a7f..20fa97e 100644 --- a/.github/workflows/docker-browser.yml +++ b/.github/workflows/docker-browser.yml @@ -45,6 +45,8 @@ jobs: --health-interval 10s --health-timeout 5s --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: - name: Checkout repository diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b20822b..0450952 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,20 +31,12 @@ jobs: env: TESTS_MQTT_BROKER_HOST: localhost 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: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Start mosquitto + run: mosquitto -c /etc/mosquitto/conf.d/default.conf -d - name: Install Packages run: yarn install --frozen-lockfile - name: Build Browser Mode @@ -71,20 +63,12 @@ jobs: env: TESTS_MQTT_BROKER_HOST: localhost 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: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Start mosquitto + run: mosquitto -c /etc/mosquitto/conf.d/default.conf -d - name: Install Packages run: yarn install --frozen-lockfile - name: Build @@ -200,6 +184,8 @@ jobs: --health-interval 10s --health-timeout 5s --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: - uses: actions/checkout@v4 with: diff --git a/Dockerfile b/Dockerfile index f8d4667..80c85e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,12 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en 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 # This ensures Playwright browsers are pre-installed in the container RUN npm install -g playwright@1.57.0 && \