ci: run BrowserOS test suites on PRs#514
Conversation
|
@claude review |
|
@greptileai review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Greptile SummaryThis PR enables the BrowserOS test CI workflow on pull requests, switching from a disabled Key changes:
Issues noted:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PR Push / workflow_dispatch] --> B[Matrix strategy: tools · integration · sdk]
B --> C[Checkout + Setup Bun + Install deps]
C --> D[HEAD request to AppImage URL]
D --> E{ETag or Last-Modified\npresent?}
E -->|Yes| F[Derive cache key from header value]
E -->|No| G[Fallback: hash of URL constant\n⚠ key never rotates]
F --> H[actions/cache restore]
G --> H
H --> I{Cache hit?}
I -->|Yes| J[Use cached BrowserOS.AppImage]
I -->|No| K[curl download AppImage]
K --> J
J --> L[Write browseros wrapper script\nAPPIMAGE_EXTRACT_AND_RUN=1]
L --> M[cp .env.example → .env.development]
M --> N[set +e · bun run test:cleanup]
N --> O[bun test suite with JUnit reporter\nBROWSEROS_TEST_HEADLESS=true\n--no-sandbox --disable-dev-shm-usage]
O --> P[Capture exit_code]
P --> Q{JUnit XML\nwritten?}
Q -->|No| R[Generate fallback JUnit XML]
Q -->|Yes| S[Upload artifact + Publish check\nfail_on_failure: false]
R --> S
S --> T[Write Step Summary\npass or fail]
Prompt To Fix All With AIThis is a comment left during a code review.
Path: packages/browseros-agent/apps/server/tests/__helpers__/test-runtime.ts
Line: 27-35
Comment:
**`parseExtraArgs` cannot handle quoted arguments with embedded spaces**
The current implementation splits strictly on whitespace. This means any future flag whose value contains a space (e.g. `--user-agent="Mozilla/5.0 (compatible)"` or `--window-size=1280,720`) would be split incorrectly into multiple tokens.
For now `--no-sandbox --disable-dev-shm-usage` works fine, but a small note in the function's JSDoc or a shell-style tokeniser (splitting on spaces unless inside quotes) would make it safer to extend later:
```suggestion
function parseExtraArgs(value: string | undefined): string[] {
if (!value) {
return []
}
// Note: this splits on whitespace only; arguments whose values contain
// spaces must be passed as separate entries in a future array env var.
return value
.split(/\s+/)
.map((part) => part.trim())
.filter((part) => part.length > 0)
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: .github/workflows/test.yml
Line: 103-107
Comment:
**`bun run test:cleanup` failure is silently swallowed under `set +e`**
`set +e` is applied before `bun run test:cleanup`, so if the cleanup script exits non-zero (e.g. a dangling process that couldn't be killed, or a missing script), the job silently continues into the test run. This could leave stale state that causes spurious test failures, with no indication that cleanup was the root cause.
A targeted `set -e` around the cleanup — or at minimum checking its exit code — would surface the problem immediately:
```yaml
bun run test:cleanup || echo "::warning::test:cleanup exited with $? — stale state may affect results"
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "chore: add CI artifa..." |
|
Follow-up on the AI review:
|
|
Addressing the follow-up feedback in the latest commit:
|
|
@greptileai review |
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Addressing the latest failure mode in the new head commit:
|
|
@claude review |
|
@greptileai review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@greptileai review |
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
…ution The JUnit report action creates check runs that GitHub associates with the CLA check suite instead of the Tests check suite, causing test reports to appear under "CLA Assistant" in the PR checks UI. Remove the action and rely on job status + step summary + artifact upload for test result visibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
packages/browseros-agentubuntu-latestwith headless mode and Linux-safe flagsextraArgsandheadlesssupport to test runtime so CI can pass--no-sandbox --disable-dev-shm-usageNon-blocking by design
Test report checks show failures but do not block PRs (
fail_on_failure: false). This lets the team see which tests pass/fail on Linux and fix them incrementally.Current results
get_active_page)Test plan
bun run typecheckpasses for@browseros/servergit diff --checkclean🤖 Generated with Claude Code