Repository navigation
test: catch the missed mutants from the weekly run - #145
Merged
Merged
Conversation
astrovm
marked this pull request as draft
November 22, 2026 03:22
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.
Catches or excludes all 101 mutants that the weekly run reported in Issue #138.
Closes #138
Done when
scripts/coverage-container.shpasses: fmt, clippy-D warnings, nextest, 100% line coverage. On bf221f8: 888 tests passed, lines 14345 of 14345.How each finding is handled
banner.rsprint_bannercli.rsresolve_game_path_from,detect_resolution,use_rich_prompts,setup_is_fully_specifiedrich_prompts_fit, which takes the two terminal flags, so a test can cover all cases.download.rsdownload_attemptRangeheader. The slow-mirror check moves intotoo_slow, with a test at the window minimum.proton.rssplit_numberusestrim_start_matches(the old loop timed out when mutated).configured_tool_from_configusesstd::cmp::max_by_key, so an equal priority has no second branch. New scenarios: a switch to Proton Hotfix is caught before launch, and a Proton 10 that Steam still has to download is not refused.prefix_state_inis caught by the new scenarios.main.rsin_game_modeGAMESCOPE_WAYLAND_DISPLAYandSteamGamepadUI. Removed the unusedlet _ = in_game_mode();.common.rsdefault_cache_dirADVENTURE_MODS_CACHE_DIR, so its result was never used. New integration testa_prefetched_mod_waits_in_the_app_folder_of_the_users_cachepointsXDG_CACHE_HOMEat a temporary folder, prefetches a mod, and checks the archive is inadventure-mods/downloadsthere. A new unit test checks the test version.pipeline.rsfor attempt in 1..=MAX_MOD_INSTALL_ATTEMPTS, so a mutant cannot make them endless (they timed out before).library.rswhile let Some(&0) = buf.last(). New tests: a blocked Steam folder offers a game that another list missed, and only a game that is nowhere is logged as not found.vdf.rsparse_quoted_stringchars()iterator, so there is no index math to mutate and no loop that can stop moving.app.rsToast::fadeand the offset intoTOAST_OFFSET.|| !self.toasts.is_empty()is removed from the 100 ms repaint condition:show_toastsalready asks for a repaint on every frame while a toast is open, so that term could never change anything.images.rsworker_countleaves one core for the UI, with a test. A 1600-wide screenshot shrinks to exactlyMAX_WIDTH. The prefetch test checks that a ready image stays ready.replace > with >= in decodeis equivalent (an image exactlyMAX_WIDTHwide is resized to the same size), so it is excluded with a comment.motion.rs,progress.rsslide, with a test. Theclear_modtest checks that only the other mod's download is left.setup.rson_backuses(0..current).rev().find(..). Layout math moves intomod_columns,mod_list_height,picture_size,centering_spaceandheight_changed, with tests. New UI tests: the previous-page pad button turns back, a step without a download shows no progress bar, each question has its own screen key, and the pad label is empty during the manager step.theme.rsboldwelcome.rsside_margin,tile_widthsandtile_size, with tests. The selected tile's width usesegui::lerp, and its grow time is the named constantmotion::TILE_GROW.GameCard::selectis tested with an index just past the last install. Which game has a backdrop moves intohas_backdrop, with a test. The rest ofpaint_backdropsonly paints, so it is excluded.widgets.rschoice_rowmoves intopaint_choice_row, which is excluded. The Back button chevron (back_button) is paint only and is excluded.All changes
.cargo/mutants.toml: excludepaint_choice_row,back_buttonandpaint_backdrops(paint only), and the one equivalent mutant indecode, each with a comment.src/banner.rs: new colored banner test. It puts back the global color setting when it ends.src/cli.rs: newrich_prompts_fit, used byuse_rich_prompts.src/cli_tests.rs: exact error text, mod choice and rich prompt tests.detect_resolution_uses_a_safe_fallbackis replaced bydetect_resolution_asks_the_display_server_then_xrandr, which compares with the real sources.src/external/download.rs: newtoo_slow, and tests for the empty partial file and the slow window.src/external/proton.rs:split_numberwithtrim_start_matches,max_by_keyfor the best failure, and asplit_numbertest.src/external/proton_scenarios_tests.rs: Proton Hotfix and Proton 10 download scenarios.src/main.rs: removed the unusedin_game_mode()call, new game mode test. The test leaves both variables unset.tests/download.rs: release cache folder integration test, Linux only becauseXDG_CACHE_HOMEmoves the cache only there.src/setup/common_tests.rs: test cache folder test.src/setup/pipeline.rs: boundedforretry loops in prefetch and install.src/steam/library.rs: bounded NUL trim loop.src/steam/library_tests.rs: blocked folder and "not found" log tests.src/steam/vdf.rs:parse_quoted_stringoverchars().src/ui/app.rs:TOAST_OFFSETandToast::fade, and the redundant toast term removed from the repaint condition.src/ui/app_tests.rs: window size and toast tests.src/ui/images.rs:worker_count, wide screenshot test, ready image check.src/ui/motion.rs:slide, with a test, and theTILE_GROWconstant.src/ui/progress.rs:clear_modcheck.src/ui/setup.rs:on_backwithfind, layout helpers, andheight_changedfor the centering check.src/ui/setup_tests.rs: the fake runtimes hold while a marker exists, so a test can see the Dotnet step. New pad, progress bar, screen key and layout tests.src/ui/theme.rs: font weight test.src/ui/welcome.rs:TILE_GAP,side_margin,tile_widths,tile_size,has_backdrop,egui::lerpfor the tile width, tests, one moreselectcase.src/ui/widgets.rs:paint_choice_rowand a button width test.src/setup/pipeline.rs: the mod install loop leaves at the first success through amatch, like the prefetch loop. Before, a success went through the same condition as the last attempt. Replacing that||with&&only added a pause and a second, no-op install, so no test could see it.src/setup/pipeline_tests.rs: a mod that fails once installs on the second try, with 2 downloads.src/ui/app_tests.rs: the toast sits at least 100 points above the bottom of the window, inside it. The test uses a fixed number, so a changedTOAST_OFFSETfails it.src/ui/welcome.rs:tile_widthstests for rows of 1 and 3 tiles. With 2 tiles, the gap times 1 equals the gap divided by 1, so*to/went unseen.Review
Sonnet 5.5 (high) reviewed the full diff on 7825a2d. It found 3 problems, all fixed in 36134d7. None is rejected.
paint_backdropsexclusion hid logic: which game shows a backdrop. Fixed:has_backdropholds it, with a test.XDG_CACHE_HOME, which only Linux uses. On macOS it would fail and write to the real cache. Fixed: the test is Linux only.I re-checked each fix myself: the new and changed tests pass. The "Mutants / Changed code" job checks the mutants of
has_backdrop.The changes after the review (95e87ce, 6d6dc50) keep the same behavior, and I checked them myself:
egui::lerp(small..=large, grow)computes(1 - grow) * small + grow * large, the same width as before;TILE_GROWis 0.24 s, the oldQUICK * 2.0;height_changedis the old expression. The usage limit (Room 0) allows no second agent review.The install loop change in bf221f8 is also checked by me only, for the same reason. The old
ifbroke on success, on the last attempt, or on cancel, and slept otherwise. The newmatchdoes the same in that order:Okbreaks, anErron the last attempt or after cancel breaks, any otherErrsleeps. cargo-mutants caught all 5 mutants of the new lines.It also checked these and found no change in behavior: the
parse_quoted_stringrewrite (escapes, unterminated strings, multibyte characters),split_number, themax_by_keytie, the retry loops (attempts, sleeps, reported attempt numbers, cancel), the NUL trim,on_back, the layout helpers, the removed toast repaint term, and thedecodeexclusion (withimage0.25.10).