mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-09-07 15:07:17 +00:00
test(player): wire frontend_test/ into CI
#672 added pkg/service/soundtouchweb/frontend_test/*.test.mjs (Node's built-in test runner) but never hooked them into anything: not the Makefile, not any GitHub Actions workflow. They only ran if someone happened to invoke `node --test` manually, so CI would stay green even if isSoundTouch10StereoPair or the DeviceDetail notice markup broke. Added `make test-frontend` and a step in browser-tests.yml (which already runs the Go-side chromedp player tests) to run them on every push/PR, matching the pinned actions/setup-node version already used by update-static-deps.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
cdd06e367a
commit
d987fa8c9f
@@ -40,10 +40,18 @@ jobs:
|
||||
- name: Verify a Chrome/Chromium binary is available
|
||||
# chromedp (used by the browsertest-tagged tests) discovers Chrome on
|
||||
# PATH or in a standard install location; GitHub's ubuntu-latest
|
||||
# runner image ships Google Chrome preinstalled. Fail fast with a
|
||||
# clear message here instead of a cryptic chromedp allocator error
|
||||
# if that image ever stops including it.
|
||||
# runner image ships Google Chrome preinstalled. Fail fast here with a
|
||||
# clear message instead of a cryptic chromedp allocator error if that
|
||||
# image ever stops including it.
|
||||
run: google-chrome --version
|
||||
|
||||
- name: Run browser-level player compatibility tests
|
||||
run: make test-browser
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: '24'
|
||||
|
||||
- name: Run frontend unit tests
|
||||
run: make test-frontend
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.PHONY: all build build-cli test test-coverage test-browser test-http-client test-http-client-rotate check fmt vet lint clean dev help screenshots build-stockholm-image prepare-stockholm update-static-deps dev-docs dev-docs-tidy hugo
|
||||
.PHONY: all build build-cli test test-coverage test-browser test-frontend test-http-client test-http-client-rotate check fmt vet lint clean dev help screenshots build-stockholm-image prepare-stockholm update-static-deps dev-docs dev-docs-tidy hugo
|
||||
|
||||
# Load .env if present (simple KEY=VALUE format, no shell quoting)
|
||||
-include .env
|
||||
@@ -156,6 +156,14 @@ test-browser:
|
||||
@echo "Running browser-level compatibility tests..."
|
||||
$(GOTEST) -tags browsertest -v ./pkg/service/soundtouchweb/...
|
||||
|
||||
# Unit tests for the embedded player's static JS modules (see
|
||||
# pkg/service/soundtouchweb/frontend_test/), run via Node's built-in test
|
||||
# runner. Not part of `test`/`check`, since they need a Node binary matching
|
||||
# package.json's engines field, same reasoning as test-browser needing Chrome.
|
||||
test-frontend:
|
||||
@echo "Running frontend unit tests..."
|
||||
node --test pkg/service/soundtouchweb/frontend_test/*.test.mjs
|
||||
|
||||
check: fmt vet test test-http-client
|
||||
|
||||
# Archive any existing tests/integration/testdata/ to a timestamped sibling
|
||||
@@ -516,6 +524,7 @@ help:
|
||||
@echo " test - Run tests"
|
||||
@echo " test-coverage - Run tests with coverage report"
|
||||
@echo " test-browser - Run browser-level (chromedp) player compatibility tests"
|
||||
@echo " test-frontend - Run player static JS unit tests (Node's test runner)"
|
||||
@echo " test-http-client - Run .http integration tests via Docker Compose"
|
||||
@echo " test-http-client-rotate - Archive tests/integration/testdata/ before a fresh run (non-destructive)"
|
||||
@echo " check - Run fmt, vet, and tests"
|
||||
|
||||
Reference in New Issue
Block a user