Repository navigation
Make the nightly mutation gates pass again - #31
Merged
Merged
Conversation
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.
The nightly
rust-mutationandfrontend-mutationjobs have been red on master for weeks. With this PR, both pass locally.Rust (
npm run mutants:rust)The run at the last nightly (41334596805) had 64 MISSED mutants plus 11 timeouts and exited 3. cargo-mutants gives any timeout its own non-zero exit code, so timeouts were failing the gate as well, which contradicts the note in AGENTS.md. After the riida-core split, 3 more misses appeared in
config::collapse_home_path: its callers stayed in the app crate, and cargo-mutants runs only the mutated package's tests.epub_image(OPF layout parsing, viewBox/viewport sizes,single_image_href,jpeg_dimensions,percent_decode,content_type_for,spread_side_str),fulltext_extract::html_to_text,BookIndexInput::is_pdf/is_epub,config::collapse_home_path, and the tantivy tokenizer'stoken_mut.finish_write's merge wait andconsolidateare now tested deterministically. The tests seed segments withNoMergePolicy, then check that the code under test merges them.docstore_compression: cargo-mutants 27 does not applyexclude_reto struct-field deletion mutants at all. Even--exclude-re docstore_compressionleaves it in--list. A tempdir test now asserts the zstd doc store. Because it is tested, the oldopen_or_createexclusion is dropped. The quirk is documented inmutants.toml.jpeg_dimensionshad equivalent mutants:|vs^on disjoint bits, and a redundantlen < 4guard. They are rewritten withstarts_withandu16::from_be_bytes, so those mutants are no longer generated.pdfium_diris excluded because it reads a globalOnceLock. Three name-specific patterns exclude mutants that can only hang: deleting an XML read loop'sEofarm, a byte cursor that stops advancing, andTokenStream::advance -> true. The patterns name the mutation, not the function, so every other mutant in those functions stays in scope. AGENTS.md is corrected to match.Local result, with the Nix dev shell on top of 97958eb:
npm run mutants:rust -- -j 4→624 mutants tested in 21m: 550 caught, 74 unviable, exit 0.Frontend (
npm run mutants:frontend)ts.parseConfigFileTextToJson is not a function. Stryker 10.1.1 (the latest) uses the TypeScript JS API in its tsconfig preprocessor, and TypeScript 7 (126a9c9) no longer ships that API. That preprocessor only rewritesextends/referencespaths that point outside the sandbox. Our tsconfig has neither, sotsconfigFilenow points at a file that does not exist, which skips the preprocessor.src/pdf-page-fixtures.tsholds test-only helpers but was being mutated. It is now excluded frommutate.mutants:frontend:list(fixed). It used--dryRun, which Stryker 10 renamed to--dryRunOnly.pdf-deskew.ts,pdf-trim.ts,pdf-gray-image.tsandpdf-page-sample.tsmade their tests about 300× slower.testTimeout; otherwiseresolvePdfTrimBoxestimed out even at 60 s.mutate, as documented in AGENTS.md. They stay covered by unit tests and the v8 coverage thresholds.Verification
cargo nextest run --workspace(all pass),rust:fmt:check,rust:lint,fmt:checknpm run mutants:rustexits 0 (above)npm run mutants:frontend→ final mutation score 53.70 (thresholdbreak: 50), done in 1 min 52 s