Skip to content

Tests: 0.9.0 cross-feature and review-fix coverage - #511

Closed
fabiodalez-dev wants to merge 36 commits into
feat/fines-ledgerfrom
test/0.9.0-coverage
Closed

fabiodalez-dev wants to merge 36 commits into
feat/fines-ledgerfrom
test/0.9.0-coverage

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Test-only PR on top of the 0.9.0 stack (#502 → #510), plus two small fixes the new tests exposed. I am covering what the per-feature specs do not exercise: flows that cross several 0.9.0 features, the late review fixes, zero-config equivalence with 0.8.9, and the quoted-search rule (#501) on the search boxes the stack added.

54 new tests: 35 Playwright E2E + 19 unit checks, all green on my local slot (Apache + PHP-FPM, MySQL 9.6), run one file at a time and then all three spec files together (35/35).

CI: every 0.9.0 Playwright suite now runs in the E2E workflow

.github/workflows/ci-e2e.yml listed its specs one by one and none of the 36 suites added by the 0.9.0 stack ran there. I added a job, 0.9.0 feature suites, with two groups that run in parallel next to the existing full E2E job:

  • circulation (17 specs, 199 tests): circulation-card, circulation-consultation, circulation-interop, circulation-patron-types, circulation-reservations, circulation-rules-matrix, circulation-settings-access, closures-calendar-admin, closures-calendar-circulation, closures-calendar-loans, debt-block, fines-closed-days, fines-ledger, fines-patron-types, stack-090-integration, stack-090-review-fixes, stack-090-zero-config.
  • catalogue (19 specs, 209 tests): attendance-090, catalogue-cards-090, inventory-stocktake, the seven issue-501-* suites, marc-bulk-export, marc-bulk-import, marc-copy-cataloging, patron-cards, patron-photo, rda-types-090, statistics-090, suppliers-090, user-import.

The job uses the same environment as the deep regression shards: Apache with mod_php, MySQL 8, Mailpit behind a real sendmail transport (msmtp), the CI MySQL wrapper, a fresh install bootstrapped by full-test.spec.js, then the shared seed fixtures (plugin preflight, archives, catalogue). I added poppler-utils, because patron-cards and patron-photo read the generated PDFs back. patron-photo runs with Chromium's fake camera, so nothing is skipped for hardware.

The result audit (scripts/ci-audit-playwright-results.js) gained an optional PLAYWRIGHT_MAX_SKIPPED ceiling. The new job sets it to 0: a test that skips, for whatever reason, fails the gate. Each spec list is explicit and every listed file must exist, so a new suite is added on purpose. The Playwright CI policy check passes (254 specs classified).

Green run on the branch head: https://github.com/fabiodalez-dev/Pinakes/actions/runs/40751777057 (all three jobs). circulation 199 passed in 17.5 min of tests (29.6 min job), catalogue 209 passed in 10.8 min (23.4 min job), 0 skipped, 0 flaky, 0 retries. The existing full E2E job stays green (19.5 min). Locally on my slot, each group in one invocation: catalogue 209/209, circulation 199/199.

No app bug came out of the CI run: every suite passed on the fresh CI install at the first attempt. While reviewing the cleanup code for a fresh database I fixed the restore issues the review pointed out (570e846):

  • table snapshots (closures, loan rules, email settings) travel hex-encoded and are restored in one transaction, so a description with an apostrophe or a backslash comes back intact and a failed restore leaves the original rows;
  • the email settings are always reset, so an install that had none no longer keeps the Mailpit SMTP rows written by the zero-config return test;
  • ncip-server and mobile-api are deactivated again when the suite activated them, and the activation is checked;
  • every cleanup step runs even if an earlier one throws; the stocktake cleanup removes scans and expected copies before the session.

Bugs found and fixed here

  • Suppliers list search ignored search for author Haffner #501 (app/Views/fornitori/index.php). It is the one search box of the stack that filters in the browser, and it used a plain includes(): a quoted "Müller" matched nothing, because the quotes were searched as characters, and an unquoted muller did not find Müller. It now follows the ExactSearch rules: unquoted words ignore accents and case, a quoted group (straight or typographic quotes) keeps the exact spelling with case ignored, every term has to match, and a box with only quotes filters nothing. The quote hint shown under the other admin filters is now under this box too (the string is already translated in all five locales). E1–E3 fail on the previous view and pass with the fix.
  • MARC 21 import, double period in corporate and meeting names (Marc21LibriMapper::entryName()). When $a keeps its final period because it ends with an initial (Istituto X.), the name was joined to its unit as Istituto X.. Ufficio studi. Unit check 4 covers it.

tests/stack-090-integration.spec.js: 9 E2E

The same reader goes through patron type, closures, fines and the debt block, all from the admin UI. The global fine settings stay empty, so every charge and block comes from the patron type.

  1. A patron type with its own loan length (10 days), daily fine (1,00), grace 0 and debt threshold (2,00) is created from the circulation tab.
  2. It is assigned from the user edit form, and the reader record shows it.
  3. A closure on the type due date: the desk proposes and stores the next open day.
  4. Late return: due 6 days ago with 2 closed days in between, so the loan page and the return screen show 4,00 and 4,00 is charged. The reader record shows "Prestiti bloccati".
    5–7. The website, the Mobile API (not_eligible with the debt message) and NCIP (User Ineligible) refuse the reader.
  5. A payment from the reader record lifts the block: the website request, the app request and the NCIP checkout all go through, and the NCIP due date is moved over the closure.
  6. A default-type reader returning just as late over the same closures pays nothing and is not blocked.

tests/stack-090-zero-config.spec.js: 8 E2E

The install is put in the "nothing configured" state (empty calendar and matrix, empty fine settings) and restored afterwards.

  1. The settings, circulation and calendar pages show nothing configured, and saving the loans tab unchanged turns nothing on.
  2. The desk due date is today + loan_duration_days.
  3. A renewal adds loan_duration_days and counts one renewal.
  4. A reader request, then its approval: due after loan_duration_days, pickup deadline after pickup_expiry_days.
  5. A late return: no accruing fine on the loan page, no fine preview and no waiver box, no ledger row. In Mailpit, the return email has no fine line (and no {{multa}} placeholder) and there is no fine email.
    6–8. A reader who owes 50,00 in the ledger is not blocked on the website, the Mobile API or NCIP. The NCIP due date is today + loan_duration_days.

tests/stack-090-review-fixes.spec.js: 18 E2E

  • A. Admin-only settings for staff (4). Staff opening /admin/calendar lands on the dashboard with the admin-only message. Every calendar POST from staff (weekdays, closures create/update/delete, preset, ICS import) is refused and changes nothing. The administrator still edits the same closure. On the visitor log, staff sees no retention or purge form, the direct POSTs change nothing, and the administrator's purge removes the old visit.
  • B. Ledger desk forms (3). A manual charge sent twice is recorded once, and so is a waiver sent twice. The same form key replayed with a different amount is refused with duplicate_request, and the page says so.
  • C. Stocktake (2). A copy recorded as damaged that turns up is reported as found again, with "(danneggiato)" and not as out of the filter. Closing with "mark missing as lost" marks only the missing copy and leaves the turned-up one as it was recorded.
  • D. MARC (4). A 111/711 meeting import through the UI keeps $e in the name and reads $j as the relator (curatore). An overwrite that turns a book into a DVD clears the RDA overrides of the old material. An overwrite with the same media type keeps them. A book with 450 long-named contributors, exported from the book list selection, comes out as a reduced record instead of being skipped.
  • E. search for author Haffner #501 on the new boxes (5). On the suppliers list: an unquoted word, a quoted word, mixed words, and quotes only. Then the users list with the patron type filter plus a quoted surname, and the book list reached from "Libri di questo fornitore" with a quoted title.

tests/stack-090-review-fixes.unit.php: 19 checks

These run automatically through scripts/ci-run-unit-tests.sh (glob).

  • MARC X10/X11 name entries (4).
  • ISO 2709 export: full record with its own cut notes, reduced record with at most 20 authors and 5 publishers (3).
  • extraColumnUpdates() on a create, on a media change with no overrides, and on a media change that replaces some overrides and clears the others (3).
  • Zero config: empty or 0 fine settings mean off, and dueDateFor() without a calendar across month ends and DST (4).
  • FineCalculator with closed weekends and the grace threshold (2).
  • Stocktake classification order (1).
  • A source guard (2): no bare LIKE ? on typed input in the 0.9.0 search code (the stocktake shelf-mark range is the only allowlisted one), and the suppliers box keeps the quote tokenizer and the hint.

Checks

  • PHPStan level 5 on the full tree: 0 errors (re-run after the CI changes).
  • scripts/ci-check-locales.py: clean (no new strings).
  • Neighbouring suites re-run green: suppliers-090.spec.js and marc-bulk-import.spec.js (15/15), plus the marc-library, marc-import-robustness, sru-roles-danmarc2, unimarc-standards and marc-oai-byte-identity unit tests.
  • Every spec cleans up what it creates: settings, closures, patron types, readers, books, suppliers, stocktake sessions, visits, MARC authors.

Summary by CodeRabbit

  • Nuove funzionalità
    • La ricerca dei fornitori accetta più termini: quelli non racchiusi tra virgolette ignorano gli accenti, mentre quelli tra virgolette richiedono una corrispondenza esatta dopo la normalizzazione, senza distinguere tra maiuscole e minuscole. I risultati includono solo le voci che corrispondono a tutti i termini.
    • Un suggerimento nel campo di ricerca spiega come usare le virgolette per cercare una grafia esatta.
  • Correzioni
    • Nell’esportazione MARC, i nomi con unità subordinate non ricevono un punto aggiuntivo quando la parte precedente termina già con un punto.

Loading
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