Skip to content

test(scf-core): the whole profile feature is excluded from pnpm test; 7 section editors have no tests #593

Closed

Description

@thinkclay

scf-core holds every line of profile UI logic and is explicitly excluded from the default test command, so none of it runs on pnpm test or in CI.

Evidence

package.json:149

"test:unit": "… nx run-many -t test --parallel=1 --exclude=@scaffald/integration-test,@scaffald/ui,scf-core"

and :119 — "test": "pnpm test:unit && pnpm test:api". Running it separately (npx vitest run --config packages/scf-core/vitest.config.ts <profile dirs>) gives 25 files, 218 passed, 0 failed, 15 skipped — the tests are healthy, they simply never execute. (The pool: 'forks' workaround for #504 is already in place at packages/scf-core/vitest.config.ts:21.)

Coverage of the profile surface

feature source files test files
features/profile 102 11
features/profile-wizard 15 12
features/profile-import 6 2
features/profile-completion 4 1
features/resume 10 2
features/background-check 33 2
features/user-profile 12 0
features/id-verification 6 0
features/prerequisites (onboarding schema) 2 0

Every section editor a user actually types into is untested:

  • profile-general-left.tsx (465 lines)
  • profile-education-left.tsx (1,176)
  • profile-certifications-left.tsx (1,155) and -right.tsx (711)
  • profile-skills-left.tsx (227) and -right.tsx (345)
  • profile-experience-right.tsx (282)

Nearly half the passing files (12/25) cover the orphaned Profile Wizard (#584). ProfileWizard.test.tsx has all 3 of its tests skipped.

Acceptance

  • scf-core is removed from the test:unit exclude list and the suite is green in CI.
  • Each of the seven untested editors above gains a test covering: populate-from-API, edit, save payload shape, and failed-save error surface.
  • features/prerequisites (the onboarding schema) and features/id-verification gain at least schema/hook-level tests.
  • The 15 currently-skipped assertions are either fixed or deleted with a reason.

Activity

  1. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Part of the profile-building audit rollup: #594

  2. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Fixed in #604. scf-core is out of the test:unit exclude list and the suite is green: 955 passed, 61 skipped, 0 failed, and it completes without OOM — contrary to the premise of #504, the pool: 'forks' workaround already in tree is working.

    The two failures blocking it were the harness, not the components: expect(container.firstChild).toBeNull() in two assessment widget tests, where renderWithProviders wraps in BeyondUIThemeWrapper — a real element, so firstChild can never be null and the assertion failed whether or not the widget rendered.

    Also wired functions/api/__tests__/lib/*.test.ts into the Deno runner and CI; 34 assertions there had never executed.

    The per-editor tests this issue also asked for landed alongside their fixes rather than in one batch — buildGeneralInfoPatch (#597), profile-sync rewritten against a real QueryClient (#598), calculateTotalExperience and ScaffaldLogo (#599), wizard-to-profile (#605).

  3. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Reopening — I closed this incorrectly.

    #604 removed scf-core from test:unit's exclude list on the strength of a JSON report showing 957 passed / 0 failed. But vitest run exits 1 regardless, so pnpm test went red on main for anyone running it locally. Reverted in #606.

    The OOM in #504 is real; my claim that it wasn't was based on reading the wrong file. I grepped a background task's output for "heap out of memory" and got nothing, because that file held only my own echo lines — vitest's stderr went elsewhere and I never read it.

    Measured properly:

    heap files assertions success exit
    4096 142 957 passed, 0 failed true 1 (OOM)
    8192 143 978 passed, 0 failed true 1 (OOM)

    Every test passes. The failure is the parent process at teardown, so a bigger ceiling does not help — 8GB just gets further before dying. That is #504's job.

    What #604 did land, and is worth keeping

    What is left here

    Separately, #606 fixed two files that were failing to collect — invisible to a pass/fail count, since such a file reports zero of each. One was a react-native-svg mock that existed but was never aliased in vitest.config.ts; that alias now benefits any SVG-rendering test.

  4. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Status after today's work on #504.

    The coverage half of this issue is done and merged. The 7 previously-untested section editors have tests, __tests__/lib/*.test.ts is in the Deno runner glob, and the e2e specs point at live routes (#592). What remains is purely making the suite runnable in CI.

    That remains blocked. I bisected #504 today and ruled out three hypotheses — the json reporter, a single heavy file, and raw file count. There is now a deterministic 7-minute reproducer (--shard=3/12) with clean neighbouring shards for A/B testing, and the decisive signal is that tests execute in 4.68s of a 452s run: the parent is GC-thrashing on what it retains per file, not doing work. Full detail on #504.

    Concretely, to close this:

    For anyone picking this up: the suite is green. 139 of 143 files pass, 978 assertions, 3 skipped files. Nothing is failing — the process dies at teardown. So this is a build-infrastructure task, not a test-fixing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions