-
Notifications
You must be signed in to change notification settings - Fork 0
ci: run viewer/tests in CI (close the viewer-coverage gap) #403
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,42 @@ jobs: | |
| - name: Voice tests (torch-free; null backend + static metadata) | ||
| run: uv run --directory servers/voice --group dev pytest -q | ||
|
|
||
| viewer-tests: | ||
| # The viewer is where most recent regressions landed, but its suite was not in | ||
| # CI (three viewer PRs each had to caveat "verified locally"). This job runs the | ||
| # whole viewer/tests/ suite, single-process, on push + PR so viewer regressions | ||
| # are caught in CI like the engine/rules/voice suites. | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install Node (for the JSX behaviour harness) | ||
| # A subset of viewer tests transpile the real .jsx through the VENDORED | ||
| # babel-standalone (viewer/openworlds/vendor/) and run it under node's `vm`. | ||
| # Babel is vendored and the harness only requires node built-ins (fs, vm), so | ||
| # NO `npm install` is needed — just a node binary on PATH. Without node these | ||
| # tests `skipIf` themselves; we install it so they actually RUN in CI. | ||
| uses: actions/setup-node@v4 | ||
|
Comment on lines
+30
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Show the referenced section of ci.yml with line numbers
if [ -f .github/workflows/ci.yml ]; then
echo "---- .github/workflows/ci.yml (lines 1-120) ----"
nl -ba .github/workflows/ci.yml | sed -n '1,120p'
else
echo "Missing: .github/workflows/ci.yml"
fi
# 2) Check if persist-credentials is already set anywhere in workflows
echo "---- Searching for persist-credentials in .github/workflows ----"
rg -n "persist-credentials\s*:" .github/workflows || true
# 3) List all action uses across workflows (only 'uses:' lines)
echo "---- Listing all uses: lines across .github/workflows ----"
rg -n "^\s*uses:\s*([^\s]+)" .github/workflows || true
# 4) Narrow to the specific actions mentioned in the comment
echo "---- Searching for actions/checkout, setup-uv, setup-node usage ----"
rg -n "uses:\s*(actions/checkout@|astral-sh/setup-uv@|actions/setup-node@)" .github/workflows || trueRepository: electricsheephq/WorldOS Length of output: 177 🏁 Script executed: #!/bin/bash
set -euo pipefail
if [ -f .github/workflows/ci.yml ]; then
echo "---- .github/workflows/ci.yml (first 160 lines with line numbers) ----"
awk 'NR<=160{printf "%d\t%s\n", NR, $0}' .github/workflows/ci.yml
else
echo "Missing: .github/workflows/ci.yml"
fi
echo "---- Searching for persist-credentials in .github/workflows ----"
rg -n "persist-credentials\s*:" .github/workflows || true
echo "---- Listing all uses: lines across .github/workflows (uses only) ----"
rg -n "^\s*uses:\s*" .github/workflows || true
echo "---- Searching for actions/checkout, astral-sh/setup-uv, actions/setup-node usage ----"
rg -n "uses:\s*(actions/checkout@|astral-sh/setup-uv@|actions/setup-node@)" .github/workflows || trueRepository: electricsheephq/WorldOS Length of output: 4091 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show macos-swift.yml with line numbers
if [ -f .github/workflows/macos-swift.yml ]; then
echo "---- .github/workflows/macos-swift.yml (first 120 lines) ----"
awk 'NR<=120{printf "%d\t%s\n", NR, $0}' .github/workflows/macos-swift.yml
fi
# Confirm there is no persist-credentials in that file
if [ -f .github/workflows/macos-swift.yml ]; then
echo "---- persist-credentials occurrences (macos-swift.yml) ----"
rg -n "persist-credentials\s*:" .github/workflows/macos-swift.yml || true
fiRepository: electricsheephq/WorldOS Length of output: 1243 Harden workflow action supply-chain usage (pin SHAs) and disable checkout credential persistence. In 🛡️ Proposed fix- - uses: actions/checkout@v4
+ - uses: actions/checkout@<FULL_LENGTH_COMMIT_SHA>
+ with:
+ persist-credentials: false
- name: Install uv
- uses: astral-sh/setup-uv@v5
+ uses: astral-sh/setup-uv@<FULL_LENGTH_COMMIT_SHA>
- name: Install Node (for the JSX behaviour harness)
- uses: actions/setup-node@v4
+ uses: actions/setup-node@<FULL_LENGTH_COMMIT_SHA>🧰 Tools🪛 zizmor (1.25.2)[warning] 30-30: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 30-30: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 32-32: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 39-39: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| with: | ||
| node-version: "20" | ||
| - name: Create + activate a venv with the viewer test deps | ||
| # Most viewer tests import viewer/server.py (stdlib-only at import time) and need | ||
| # no third-party deps. The exception is test_portrait_gen's real-subprocess test, | ||
| # which shells the engine via `uv run --directory servers/engine --no-project` | ||
| # (a bare interpreter) to prove the null image provider opens no socket. That | ||
| # child resolves the ACTIVE venv, so installing pydantic (the engine's runtime | ||
| # dep, declared in servers/engine/pyproject.toml) here lets the engine subprocess | ||
| # import `store`/`imagegen` and the test runs instead of erroring on import. | ||
| run: | | ||
| uv venv .venv-viewer --python 3.12 | ||
| echo "VIRTUAL_ENV=$PWD/.venv-viewer" >> "$GITHUB_ENV" | ||
| echo "$PWD/.venv-viewer/bin" >> "$GITHUB_PATH" | ||
| uv pip install --python .venv-viewer pydantic pytest | ||
| - name: Viewer tests (single-process; JSX harness via node + vendored babel) | ||
| # -p no:xdist keeps this single-process (no parallel workers) — lean by design. | ||
| run: python -m pytest viewer/tests -q -p no:xdist | ||
|
|
||
| license-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
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.
Add explicit least-privilege
permissionsfor this job.This job currently inherits default token permissions, which is broader than needed for read-only test execution.
🔐 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 23-57: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents