Skip to content

test: run generate-shared-config and update-meeting-recordings in process for coverage - #227

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-prebuild-scripts-inprocess
Oct 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-prebuild-scripts-inprocess

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

scripts/generate-shared-config.ts (101 lines) and scripts/update-meeting-recordings.ts (132 lines) reported 0% coverage on main@00ff35a even though each has a passing dedicated suite — both existing tests drive the script through spawnSync(tsx, …), which v8 never instruments. Same defect as #194 fixed for sync-sibling-docs.ts; these were the last two scripts/** files affected.

This PR adds companion in-process suites and keeps the subprocess suites (they still validate the real CLI entry):

  • scripts/update-meeting-recordings.inprocess.test.ts (8 cases): process.chdir() into a temp dir, stubbed global fetch, vi.resetModules() + import, vi.waitFor on the console spy that main() always ends with. Covers merge/sort, fetch throw, non-2xx status, non-Error rejection, unparsable store, malformed video ids, unsafe link/thumbnail hosts and schemes, *.ytimg.com subdomains, entity single-decoding, and the metadata-only-drift rewrite path.
  • scripts/generate-shared-config.inprocess.test.ts (4 cases): vi.mock("node:fs") with the default export overridden so reads of public/config/shared.json are served from a fixture and the write is captured — the repo's real shared.json is never written. Asserts the generated maps against src/config/versions.ts, optional-field omission, and preservation of hand-maintained surveyUrl/relatedProjects/editBaseUrls.
  • vitest.config.ts: thresholds ratcheted 82/82/77/81 → 85/85/79/84 (measured 87.9 lines / 87.8 funcs / 81.8 branches / 87.0 stmts).

Evidence

before after
generate-shared-config.ts lines 0% 100%
update-meeting-recordings.ts lines 0% 100%
All files lines 85.72% 87.91%
Tests 841 853

npx vitest run --coverage, npx tsc --noEmit, npx eslint scripts/*.inprocess.test.ts, npx prettier --check all pass locally (Node 26.10, vitest 5.0.3).

Closes #226


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…cess for coverage

Both prebuild scripts were only exercised through spawnSync(tsx), so v8
reported them at 0% lines despite passing dedicated suites. Add companion
in-process suites (stubbed fetch + chdir for the recordings feed; mocked
node:fs default so the real public/config/shared.json is never written)
and ratchet the coverage thresholds to the newly measured values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit 26fb110
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ac415d371110a00084a4159
😎 Deploy Preview https://deploy-preview-227--hivecommons-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read both new suites against the scripts they exercise and ran them locally at 26fb110; this looks correct to me.

What I verified:

  • scripts/generate-shared-config.inprocess.test.ts:27-54 mocks node:fs with the default export overridden, which is the shape generate-shared-config.ts:18 actually imports (import fs from 'node:fs'). After npx vitest run --coverage, git status is clean — the repo's public/config/shared.json is not written.
  • scripts/update-meeting-recordings.inprocess.test.ts:71-81 relies on process.chdir(); vitest 5 defaults to the forks pool, so this is legal (it would throw under threads). The .test-work/ layout matches the existing update-meeting-recordings.test.ts:17 and sync-*.main.test.ts suites.
  • Full run: 87 files / 853 tests pass; coverage totals 87.91 lines / 87.8 functions / 81.76 branches / 86.99 statements, so the raised gate in vitest.config.ts:33-36 (85/85/79/84) holds with ~2–3 points of headroom.

One note, not a defect: the branch is based on 00ff35a and main has since moved (docs/content syncs), so a rebase may be needed before merge. I have not approved or merged anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 124d9a8 into main Oct 5, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-prebuild-scripts-inprocess branch October 5, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] generate-shared-config.ts and update-meeting-recordings.ts report 0% — subprocess-only tests hide them from the coverage ratchet

0 participants