Skip to content

Commit 211468e

Browse files
committed
feat: document edge case for GetInputAudioTracks tests in headless OBS and update plugin integration harness notes
1 parent 5b8533f commit 211468e

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

docs/wiki/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _Updated by Claude on every ingest. Read this first when querying the wiki._
88

99
## Edge Cases
1010

11-
_(none yet)_
11+
- [[obs-audio-tracks-no-inputs]] — GetInputAudioTracks tests fail in headless OBS (no audio sources seeded); fix: ctx.skip()
1212

1313
## Decisions
1414

docs/wiki/log.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ _`## [YYYY-MM-DD] file | pages/type/name.md (mid-session)`_
1717
## [2026-04-08] ingest | obs-plugin/PluginInstall.md — created pages/concepts/obs-plugin-install.md
1818
## [2026-04-08] ingest | llm-wiki.md — archived to raw/articles/, created pages/sources/llm-wiki.md
1919
## [2026-04-08] file | pages/decisions/decision-800-line-limit.md (mid-session)
20+
## [2026-04-08] file | pages/edge-cases/obs-audio-tracks-no-inputs.md (mid-session)

docs/wiki/pages/concepts/plugin-integration-harness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The tests verify the full round-trip: a call into `obsPlugin.js` produces a corr
3434
npm run test:integration
3535
```
3636

37-
Note: a separate `tests/integration/obs/` suite may require a local OBS installation (`obsHelper.mjs`). That suite is environment-specific. The harness tests are the stable CI contract.
37+
A separate `tests/integration/obs/obsOrchestration.test.js` suite tests OBS WebSocket helpers against a live headless OBS process started by `obsHelper.mjs`. The whole suite skips automatically when OBS is not installed (`describe.skipIf(!isOBSAvailable())`). Tests within the suite that depend on resources that may be absent (e.g. audio inputs, which `_writeOBSConfig` does not seed) guard with Vitest's `ctx.skip()` rather than a hard assertion — see [[obs-audio-tracks-no-inputs]].
3838

3939
### Environment variables (transport layer)
4040

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
type: edge-case
3+
tags: [testing, obs, vitest, obsOrchestration]
4+
updated: 2026-04-08
5+
sources: 0
6+
---
7+
8+
# Edge Case: GetInputAudioTracks tests fail when headless OBS has no audio inputs
9+
10+
**Trigger:** Running `obsOrchestration.test.js` in CI (or any environment where the headless OBS config has no audio sources)
11+
**Symptom:** `AssertionError: No OBS input responded to GetInputAudioTracks: expected null to be truthy` — two tests in the `GetInputAudioTracks / SetInputAudioTracks` describe block fail
12+
**Root Cause:** `_writeOBSConfig` in `obsHelper.mjs` seeds the scene collection with `sources: []`. `GetInputList` therefore returns no audio inputs, so `findTrackableInputName()` returns `null`. The original tests asserted `expect(inputName, '...').toBeTruthy()` which always fails in this environment.
13+
**Fix:** Replace `expect(inputName, '...').toBeTruthy()` with a Vitest `ctx.skip()` guard. The test receives the Vitest context as its first argument; when no trackable input is found the test skips rather than fails.
14+
15+
```js
16+
it('reads inputAudioTracks from at least one OBS input', async (ctx) => {
17+
await withRawObs(async (obs) => {
18+
const inputName = await findTrackableInputName(obs)
19+
if (!inputName) return ctx.skip()
20+
// ...
21+
})
22+
})
23+
```
24+
25+
`ctx.skip()` throws a `SkipError` that propagates through `withRawObs`'s `try/finally` cleanly — the `finally` only calls `obs.disconnect().catch(() => {})`, so the skip error is not swallowed.
26+
27+
**Prevention:** Any integration test that depends on a resource that may legitimately be absent (audio devices, specific OBS sources, network services) should guard with `ctx.skip()` rather than a hard `expect` assertion.
28+
29+
## Related
30+
31+
- [[plugin-integration-harness]]

0 commit comments

Comments
 (0)