Test hygiene: coverage floors, leaked temp dirs, dist-dependent tests
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github-actions, typescript
調査の方向性
Start with the listed test files, vitest.config.ts, .github/workflows/publish.yml, and ci.yml; read CONTRIBUTING.md and AGENTS.md, then run npm run build && npm test. The issue lists six separate test and CI problems, with locations, triggers, and proposed fixes. Done means each item is fixed or closed with a reason and npm test passes.
索引モデルが issue の本文から書いたものです。
説明
Summary
Lower-priority test and CI items. The suite passed during the audit (1,755 passed, 30 skipped, 92.5% lines).
Related: #302
Items
-
Coverage floors trail measured coverage by up to 30 points and skip most high-risk files
Where:vitest.config.ts:16,vitest.config.ts:20,vitest.config.ts:27,vitest.config.ts:28,vitest.config.ts:30,vitest.config.ts:31Floors against this run (which lacks the capture smoke, so CI is equal or higher):
src/utils/**lines 90 vs 96.60;src/tools/**77 vs 85.34;events.ts66 vs 96.65;lifecycle.ts77 vs 93.84;sessions.ts88 vs 93.19;recorder.tslines 88 vs 96.80, branches 60 vs 69.23. The comment at vitest.config.ts:22-24 quotes Nov 2026 figures (events 70.0, lifecycle 81.1) that the lifecycle tests have since passed. Onlyrecorder.tshas a branch floor; there is none for functions. No floor at all covers top-levelsrc/*.ts(cli.ts89.16,setup.ts77.64,serverLifecycle.ts67.24 lines / 18.75 functions) or the confinement and delete files (paths.ts,roots.ts,argPaths.ts,validate.ts,expr.ts,editSpec.ts,retention.ts,fileLock.ts,src/tools/deleteRecording.ts), which are at 92-100% today only by habit.src/tools/**branches are 62.96% with no floor.Trigger: Compare
vitest.config.tsthresholds withcoverage/coverage-summary.jsonafternpm run test:coverage.Fix: Read the numbers from a green CI run's coverage summary (Windows Node 22 leg), then set each floor about 3 points under:
src/utils/**lines ~93 and branches ~84;events.ts~93;lifecycle.ts~90;sessions.ts~90;recorder.ts~93 / branches ~65;src/tools/**~82 and branches ~58. Add per-file floors forpaths.ts,roots.ts,argPaths.ts,validate.ts,expr.ts,editSpec.ts(lines 95),retention.ts,fileLock.ts,pipelineRun.ts,src/tools/deleteRecording.ts,src/cli.ts,src/setup.ts. Update the stale comment. -
Five test files leave a temp directory behind on every run
Where:src/__tests__/editTool.test.ts:11,src/__tests__/argPathsCoverage.test.ts:14,src/__tests__/schemaParity.test.ts:13,src/__tests__/color.test.ts:39,src/__tests__/deleteRecording.test.ts:21,src/__tests__/deleteRecording.test.ts:64editTool.test.ts,argPathsCoverage.test.ts,schemaParity.test.tsandcolor.test.tscallmkdtempSync(join(tmpdir(), "sc-...-"))at module or describe scope and contain normSyncorafterAll.deleteRecording.test.tsremoveshomein the first describe'safterAll(line 64), but the second describe (from about line 180) builds another server on the sameSCREENCAST_HOME, which recreatesedits/,recordings/andsessions.json; itsafterAll(line 195) only closes the client. After this audit's run the OS temp folder held newsc-edittool-*,sc-argcov-*,sc-parity-*,sc-lut-*andsc-delete-*directories; the machine has 615sc-*entries in total (168 parity, 147 edittool, 120 argcov, 110 delete, 55 lut).Trigger: Count
sc-*entries in%TEMP%, runnpm test, count again: five more.Fix: Add
afterAll(() => rmSync(dir, { recursive: true, force: true }))to the four files; indeleteRecording.test.tsmove thermSync(home, ...)to a file-levelafterAllthat runs after both describes. -
Tests of the built entry points skip when dist/ is missing and trust a stale build when it exists
Where:src/__tests__/integration/entryStdio.test.ts:19,src/__tests__/integration/entryStdio.test.ts:63,src/__tests__/entryCli.test.ts:7,src/__tests__/entryCli.test.ts:9,src/__tests__/integration/wgcRecorder.test.ts:18,src/__tests__/integration/wgcRecorder.test.ts:142,package.json:29Three suites spawn
dist/index.jsordist/wgcRecorder.jsand are wrapped indescribe.skipIf(!existsSync(...))."test": "vitest run"has no build step, andREQUIRE_FFMPEG=1does not make a missingdist/a failure. These are the only tests ofsrc/index.tsandsrc/wgcRecorder.ts(both 0% in the coverage report, because child processes are not measured; the config comment tracks that under #295 and #296). CI runsnpm run buildbeforenpm teston every leg, so CI is sound today.Trigger: Delete
dist/, runnpm test: three suites report skipped and the run is green. Or change the'q'handling insrc/wgcRecorder.tsand runnpm testwithout building:wgcRecorder.test.tsstill passes.Fix: In those three files, fail instead of skip when
process.env.CIorREQUIRE_FFMPEGis set and the bundle is missing (the patternffmpeg.test.ts:77uses for ffmpeg). For staleness, compare the bundle's mtime with the newest file undersrc/(excluding__tests__) and fail with "run npm run build", or add a vitestglobalSetupthat runs the build. -
publish.yml's own test step runs on Linux without ffmpeg, so 16 integration suites skip
Where:.github/workflows/publish.yml:15,.github/workflows/publish.yml:28,src/__tests__/integration/ffmpeg.test.ts:77The
build-testjob that builds and packs the tarball that gets published runsnpm testonubuntu-latestwith no ffmpeg install step and withoutREQUIRE_FFMPEG. Everydescribe.skipIf(!AVAILABLE)integration suite, the capture smoke and all Windows-only cases skip. Assumption:ubuntu-latesthas no ffmpeg on PATH (if it does, it is the apt 6.x build that ci.yml deliberately avoids, per ci.yml:32-35). The release is separately gated on green CI, so this is a second gate that checks much less than it appears to.Trigger: Read the job log of a publish run: integration suites show as skipped.
Fix: Either reuse ci.yml's pinned FFmpeg 8 steps and set
REQUIRE_FFMPEG=1, or rename the step to say it is a unit-test sanity check and require the CI run for the same SHA to be green before thepublishjob (check-runs API). -
wgcRecorder process tests assert frame counts against wall-clock sleeps
Where:src/__tests__/integration/wgcRecorder.test.ts:146,src/__tests__/integration/wgcRecorder.test.ts:152,src/__tests__/integration/wgcRecorder.test.ts:153,src/__tests__/integration/wgcRecorder.test.ts:215,src/__tests__/integration/wgcRecorder.test.ts:221At
fps: 10(line 118) the first case doesawait sleep(1000), writesq, then expectsframes >= 8and<= 16. The count depends on how long the test process's 1000 ms timer really takes and on child start-up; a timer that fires 700 ms late on a loaded runner yields 17 or more frames. The slow-encoder case sleeps 1200 ms and expects< 10. These suites have noretry, unlikecaptureSmoke.test.ts:42. It passed in this run; the concern is the hosted Windows runners, which the repo's own comments describe as loaded (captureSmoke.test.ts:21).Trigger: Run the suite while the machine is under heavy CPU load (for example alongside the editing integration suite on a 2-core runner).
Fix: Make the assertion relative to measured time: record
t0whenstarted()resolves andt1just before writingq, then expectframeswithinfps * (t1 - t0) / 1000plus or minus a margin; for the drop test, compare against frames due rather than a constant. -
The full eval oracle run is never executed in CI; vitest covers 3 of 10 tasks
Where:evals/oracle.test.ts:53,evals/oracle.test.ts:66,evals/run.ts:76,evals/tasks.ts:35,package.json:32evals/run.tsdescribes oracle mode as the self-check that "catches handler regressions" and "exits non-zero on any failure" (run.ts:10-12, 76-77), but no workflow runsnpm run eval(no match for it under.github/workflows/). The only automated use isevals/oracle.test.ts, which runsredact-api-key,cut-dead-airand a negativemedia-infocase. The oracle calls and outcome checks of the other seven tasks (export_gif under 2 MB, screen_diff, trim, contact_sheet, extract_audio, clip, speed) are not exercised anywhere.Trigger: Break
outputOfor theoutputskey in clip;npm teststays green.Fix: Run all tasks in oracle.test.ts (
runSuite(TASKS, oracleAgent, ...), the fixtures are tiny), or addnpm run build && npm run evalto the ffmpeg leg of ci.yml.
Acceptance criteria
- Every item above is fixed or closed with a reason
-
npm testpasses
Getting started
- Relevant files:
vitest.config.ts,src/__tests__/editTool.test.ts,src/__tests__/argPathsCoverage.test.ts,src/__tests__/schemaParity.test.ts,src/__tests__/color.test.ts,src/__tests__/deleteRecording.test.ts,src/__tests__/integration/entryStdio.test.ts,src/__tests__/entryCli.test.ts - How to run tests:
npm run build && npm test(alsonpm run typecheckandnpm run lint) - Related docs:
CONTRIBUTING.md,AGENTS.md
Filed by repo-audit/full-audit at b8156ef. Severity: low. Effort: M. audit-key: testing|vitest.config.ts|coverage.thresholds.trail
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 4
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/screencast-mcp のほかの issue
-
dependencies effort: small good first issue priority: low
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
TMHSDigital/screencast-mcp#509 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/screencast-mcp#508 ·
メンテナーはふだん 1 日以内に返信
-
dependencies effort: small good first issue priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/screencast-mcp#490 ·
メンテナーはふだん 1 日以内に返信
-
ci effort: small priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/screencast-mcp#460 ·
メンテナーはふだん 1 日以内に返信
-
effort: medium priority: low tech-debt
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
TMHSDigital/screencast-mcp#502 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/screencast-mcp の issue をすべて見る
似ている issue
-
from-review tech-debt testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blamechris/chroxy#9520 ·
メンテナーはふだん 1 日以内に返信
-
area:web complexity:S priority:P2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nahuelcostac/agent-hub#104 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
snaglet-org/snaglet#78 ·
メンテナーはふだん 1 日以内に返信
-
agent/guide documentation help wanted stage/010-actionable
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
kubestellar/console-marketplace#1101 ·
メンテナーはふだん 1 日以内に返信
-
Java Edition Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JSPrismarine/JSPrismarine#4178 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信