Repository navigation
test: CV and cover-letter rendering, model evaluation, frontend smoke tests - #18
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Coverage of
doc_rendergoes from 53% to 94%, andpdf_generatorfrom 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:
_MAX_SKILL_GROUPS);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 scoresjob_attributes.extracton:The pass marks sit under the first three runs (seniority 96.4%, 96.0% and 95.7%):
It lives outside
tests/, so the fake-LLM environment there never applies. Each run writesevals/last_run.json(gitignored).3. Frontend smoke tests (
frontend/e2e/)Six Playwright tests drive the production build in Chromium, with every
/apicall mocked in the browser. An unmocked call fails the test. They cover:/api/jobs;CI's frontend job runs them after the build and uploads traces on failure.
@playwright/testis pinned at 1.63.0.Testing
max_yearsparameter.