Skip to content

test: CV and cover-letter rendering, model evaluation, frontend smoke tests - #18

Merged
coderback merged 3 commits into
mainfrom
test/testing-gaps
Oct 15, 2026
Merged

coderback merged 3 commits into
mainfrom
test/testing-gaps

Conversation

@coderback

Copy link
Copy Markdown
Owner

Summary

This fills three testing gaps: CV and cover-letter rendering, the LLM's reading of job ads, and the frontend.

1. CV and cover-letter rendering (api/tests/test_documents.py)

A graduate profile shaped like a real one goes through the tailoring tool, the HTML template and WeasyPrint. The 24 new tests check:

  • section order (education first for graduates) and clickable contact and project links;
  • cleaned-up portfolio prose, a summary without pronouns, and HTML escaping;
  • every length limit;
  • what the model may not change (contact details, skills, project links);
  • the cover letter's sign-off and paragraphs;
  • page counts in the template's font, the fpdf2 fallback, and the PDF endpoints.

Coverage of doc_render goes from 53% to 94%, and pdf_generator from 55% to 92%. CI's API job now installs Pango and the Liberation fonts, so the PDF tests run there with production's font. They skip only where WeasyPrint can't load (Windows), and never in CI.

Two known gaps are strict xfails, to be fixed next:

  • skill groups after the sixth are dropped (_MAX_SKILL_GROUPS);
  • a graduate CV with everything the prompt allows runs about a fifth of a page onto page 2.

2. Model evaluation (api/evals/)

This is opt-in: it only runs with WINDRUSH_LLM_EVAL=1, because it calls the real LLM about 500 times. It scores job_attributes.extract on:

  • a blind 523-item seniority set: hand-written titles and ads, labelled junior / mid / senior;
  • the labelled sponsorship sentences from the regex tests.

The pass marks sit under the first three runs (seniority 96.4%, 96.0% and 95.7%):

  • seniority ≥ 94%;
  • each level's recall ≥ 90%;
  • at most one junior role read as senior;
  • sponsorship ≥ 90%;
  • at most 1% failed calls.

It lives outside tests/, so the fake-LLM environment there never applies. Each run writes evals/last_run.json (gitignored).

3. Frontend smoke tests (frontend/e2e/)

Six Playwright tests drive the production build in Chromium, with every /api call mocked in the browser. An unmocked call fails the test. They cover:

  • the signed-out redirect, logging in, a wrong password, and an expired session;
  • the job feed: each card's badges, plus the experience, degree and clear-filter controls reaching /api/jobs;
  • the Profile page saving comma-typed titles and locations as lists.

CI's frontend job runs them after the build and uploads traces on failure. @playwright/test is pinned at 1.63.0.

Testing

  • API suite: 631 passed, 1 xfailed, 4 skipped (the WeasyPrint tests, on Windows). In the API image, all document tests pass (24 passed, 2 xfailed).
  • The model evaluation passed against Azure: seniority 95.7% (regex 88.3%), sponsorship 28 of 29.
  • The smoke tests pass, and they caught both bugs they were checked against: the old CommaListInput re-join and a dropped max_years parameter.

A graduate profile shaped like a real one goes through the tailoring tool,
the HTML template and WeasyPrint: section order, links, project prose
clean-up, pronoun-free summary, escaping, length limits, the guardrails on
what the model may change, cover-letter sign-off and paragraphs, page counts
in the template font, the fpdf2 fallback and the PDF endpoints.

CI installs Pango and Liberation fonts so the PDF tests run there with
production's font. Two known gaps are strict xfails: skill groups after the
sixth are dropped, and a full graduate CV spills onto a second page.
api/evals scores job_attributes.extract on a blind 523-item seniority set
(hand-written, labelled junior / mid / senior) and the labelled
sponsorship sentences from the regex tests. It calls the real LLM, so it
only runs with WINDRUSH_LLM_EVAL=1 and lives outside tests/ so the fake-LLM
environment there never applies. The bars sit under the first three runs:
seniority >= 94% (runs 96.4 / 96.0 / 95.7), each level's recall >= 90%,
at most one junior read as senior, sponsorship >= 90%, <= 1% failed calls.
Six tests drive the production build in Chromium: the signed-out redirect,
logging in and a wrong password, an expired session, the job feed (each
card's sponsorship / clearance / experience / degree badges, and the
experience, degree and clear-filter controls reaching /api/jobs), and the
Profile page saving comma-typed target titles and locations as lists.
Every /api call is mocked in the browser; an unmocked call fails the test.
They catch both bugs they were checked against: the old CommaListInput
re-join and a dropped max_years parameter.

CI's frontend job now runs them after the build. The README documents the
three opt-in or new suites.
@coderback
coderback merged commit d978ec5 into main Oct 15, 2026
4 checks passed
@coderback
coderback deleted the test/testing-gaps branch October 15, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant