Convergence stress test
Seed and spec putting 10 nine-month courses on converging lessons, levels, books, exams, substitutions and enrolled students; how to run them, clean up and read the matrices; gap status.
The test checks in production, through the public APIs and demo accounts, what Lesson edit propagation describes.
Dataset
- Workspace: "Collaudo convergenze", created by the demo Owner (Marco Bianchi) with
POST /organizations, like the app's "New workspace". Never Accademia Leonardo, which is the sales demo.CSTRESS_ORGANIZATION_IDuses an existing workspace instead. - People: existing demo accounts only, added to the test workspace (
POST /organizations/:id/members): Davide, Chiara and Sara teach subjects and levels (a level's teacher always differs from its subject's), Andrea and Elena are substitutes, the Owner is the third substitute; ten demo students, two enrolled in all 10 courses, one in three, the others in one. Andrea is also a student of course 10 (edge case). No new accounts, no credentials in the state. - Courses: 10 LIVE courses from 5 October 2026 to 30 June 2027 in the
CSTRESS Convergenzaspace, published together (converging bundle). - Subjects: Maths, Italian, English with levels "1° anno" and "2° anno"; History and Science without levels; all linked to the 10 courses.
- Series: 11 weekly recurrences from the first week to the course end, shared by the 10 calendars (one per level and one "subject only" for subjects with levels, one for the others): about 4,300
calendar_eventsrows. - Books: on the Maths subject, on the Maths 1st-year level (2nd year inherits), on History; two series cite them with pages.
- Exams: per level, per subject and one without subject attached to a History lesson; in every course, two pending submissions per exam and course.
- Tag
CSTRESSin every title; state in~/.aladia/convergence-stress-state.json(CSTRESS_STATE).
Files: web-next/e2e/help/flows/_support/convergence-stress.mjs (plan and reads), _support/seed-convergence-stress.mjs (seed), calendars/convergence-stress.spec.mjs (test).
How to run
# 1. what exists and what would be created (reads and demo-account logins only)
node web-next/e2e/help/flows/_support/seed-convergence-stress.mjs --plan
# 2. create what is missing (idempotent; 25-35 minutes the first time)
node web-next/e2e/help/flows/_support/seed-convergence-stress.mjs --apply
# 3. the test (60-90 minutes); --shots for images
node web-next/e2e/help/flows/run.mjs calendars/convergence-stress
# counts at any time
node web-next/e2e/help/flows/_support/seed-convergence-stress.mjs --countsAfter a failure: rerun only what is missing
Tests no longer run as a forced chain: one failure does not stop the others. Every test that works with the substitutions active finds them in the list (or recreates them if missing), and every edit matrix puts its series back as the seed left it. So after a failure only the failed or not-run tests are rerun, without starting from scratch:
# only the failed and not-run tests of the last run (before launching another spec)
CSTRESS_RESUME=1 node web-next/e2e/help/flows/run.mjs calendars/convergence-stress --last-failed
# or by title
CSTRESS_RESUME=1 node web-next/e2e/help/flows/run.mjs calendars/convergence-stress --grep "republish|ripubblicazione"CSTRESS_RESUME=1 skips the preparation (cancelling leftover substitutions and restoring every series). The full run without CSTRESS_RESUME stays the final check before declaring the test passed. The two long substitutions stay active until the "annullamento" test cancels them (or the preparation of the next full run).
Credentials: those of the help flows (LEONARDO_EXTRA with the OWNER_* keys, LEONARDO_STATE for teachers and students). The seed publishes the courses directly (there is no course review since 27/10/2026); if publishing fails it says so and the test skips the parts that need published courses.
Load: requests in sequence or in groups of 3, retried with backoff on 429/5xx; creating a series (one long request) is never retried blindly, a search checks whether it was created. One session per account. Notices only reach the demo accounts of the CSTRESS courses.
Cleanup
node web-next/e2e/help/flows/_support/seed-convergence-stress.mjs --cleanup
node web-next/e2e/help/flows/_support/seed-convergence-stress.mjs --cleanup --drop-workspaceRemoves substitutions, exams, series, enrolments, levels, subjects, books and the added members. Published courses cannot be deleted through the API: they stay in the test workspace's space, without students. --drop-workspace also deletes the workspace, only if the seed created it. Short substitutions created by the test are cancelled at the end of the spec, the two long ones by the "annullamento" test; the dataset stays for later runs.
What the spec checks
- Structure: every occurrence is one Event shared by the 10 calendars; every series runs from the first week to the course end (minus closed days).
- Responsibles: series × month → level or subject teacher, in every course.
- Books: subject and level in the 10 courses, level inheritance, lessons citing book and pages.
- Substitutions of two months (2 Nov – 31 Dec 2026): on a level, on a subject without levels and the edge case of a subject teacher whose subject has levels; covered occurrences in the 10 courses, none outside the window, count equal to
replace-preview, materials opened by the substitute, grading with "Also pass exam grading" when the backend exposes it. - Edits: every field × every scope (
this,cascade,all×all,this), on a level-resolved and a subject-resolved series, with the substitution active; editor view and student view. - Substitution × edits, books changed during the substitution, cancellation.
- Students: republishing, the student's calendar and Home, notices (one per change, never the reason), access after forks, iCal, edge cases (student removed from a course, substitute who is also a student, overlapping substitutions, course end inside the window, time overlap). In the student's calendar (
perCalendar) the converging lesson appears once per calendar that is on (10 of 10), the Home once per lesson. - Calendar filters (
calendars/convergence-filters.spec.mjs, a student in the 10 courses, desktop and 375 + API): N calendars checked → N rows, 1 → 1 (of the checked course, two tries), 0 → 0; a non-shared lesson of a course turned off disappears; the dialog lists the 10 courses of the convergence including the hidden ones; checkboxes survive a reload and show the same on a second device (new browser context, 375), with the hidden courses on the server and no local memory left.
Report and matrices
On stdout and in CSTRESS_OUT_DIR/report.json (default <tmp>/convergence-stress):
Campo × ambito (V = verticale, H = orizzontale, sub = supplenza intatta)
mat-1 name cascade/all V:OK H:OK V+H:OK sub:OK
mat-1 time this/this V:OK H:OK V+H:OK sub:OK
Responsabili prima: serie × mese
2026-10 2026-11 2026-12 …
Matematica · 1° anno Sara Sara Sara …
studenti · calendario dello studente: ok — atteso "1 riga per lezione…", osservato {…}
Lacune viste in questa corsa:
- G6: …In report.json: structure (events, rows, first and last occurrence per series), responsibles.tables (before, during, after), substitutions (preview, creation, materials, grading), edits (one entry per series × field × scope with vertical, horizontal, combined, substitutionKept, subjectKept, students = none/all/partial n/m, timings), students (expected, observed, verdict per case), gaps.
Gaps
| Gap | Status | |
|---|---|---|
| G1 | an edit without the subject removed subject and level from the series in every course | fixed, in production |
| G2 | forks lost subject, level, room, suspension, place; links could not all be removed | fixed, in production |
| G3 | substitutions stayed on the old Event after a fork or a reschedule | fixed, in production (reschedule: this branch) |
| G4 | "All occurrences" also rewrote past lessons | fixed in this branch |
| G5 | moving a lesson did not update the substitution rows' times | fixed, in production |
| G6 | for a converging lesson the substitution row kept one course only: preview "in 1 course", notices and chat for the first course only, materials and attendance denied to the substitute in the other courses | fixed on main (one row per event and course, see Substitutions) |
| G7 | lessons created after the substitution (series extended, course added, cycles 2+ recreated at publication) are not covered | open |
| G8 | a place changed from the lesson dialog did not reach the event | fixed in this branch |
| G9 | the chosen room (roomSource) was lost in the update builder | fixed in this branch |
Student side, fixed: suspension and reschedule emails (duplicates, filter, language and timezone), per-course settings, iCal (duplicates, place, reschedules), empty Home for students, push for a cancelled substitution.