Add ProfileMigration version-migration coverage tests#45
Open
anagnorisis2peripeteia wants to merge 1 commit into
Open
Add ProfileMigration version-migration coverage tests#45anagnorisis2peripeteia wants to merge 1 commit into
anagnorisis2peripeteia wants to merge 1 commit into
Conversation
Assert the migration-step behaviour that mutation testing (issue hbashton#37) showed was largely unasserted: RequiresMigration for old/absent/current config_version, the migrated config_version reaching 5 with UsedMigration set, the Version0002 deadzone normalization, the Version0004 gyro-smoothing regrouping, the Version0005 UseTPforControls -> TouchpadOutputMode remap, and DetermineProfileVersion's LSAntiDeadZone-based v1-vs-v2 detection. Targeted attribute/element assertions rather than full-document string diffs.
Contributor
Author
|
Before/after behavioral evidence — mutation testing (Stryker.NET) of
The new tests kill 63 previously-surviving mutants and drop no-coverage mutants from 57 to 8 — the per-step migration logic ( |
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.
A follow-up to #37.
ProfileMigrationupgrades old controller-profile XML to the current format (config_version5) through a chain of steps, but only two tests cover it — and one of those (CheckJaysProfileRead) is excluded from CI for snapshot fragility — so the per-step migration logic is largely unasserted.This adds six tests that assert migration behaviour with targeted attribute/element checks (deliberately not full-document string diffs, which is what got the existing test excluded):
RequiresMigrationfor old (config_version=1), absent, and current (=5) profiles.Migrate(),config_versionreaches the current version andUsedMigrationis set — and staysfalsefor an already-current profile.Version0002: a non-positiveLSDeadZoneis normalized to the default deadzone; a positive value passes through.Version0004: legacyGyroSmoothing*nodes become theGyroMouseSmoothingSettings/GyroMouseStickSmoothingSettingsgroups (with the conditionalSmoothingMethod).Version0005:UseTPforControlsremaps toTouchpadOutputMode.DetermineProfileVersion: a version-absent profile containingLSAntiDeadZoneis detected as v2 (itsLSDeadZoneis preserved, not v1-normalized).Test-only; no behaviour change.
Local review history: https://gist.github.com/fc75801ef643a30731c2b87394c3a935
Proof manifest
Before / After (same command, same machine)
Version0005writesMouseinstead ofControls)Migrate_TransformsVersion0005_UseTPforControlsfails — fault caughtFault-injection proof (test-only PR): made
Version0005writeTouchpadOutMode.Mouseinstead ofControls, identically on base and this branch. Base + fault: suite passes (fault missed). This branch + fault:Migrate_TransformsVersion0005_UseTPforControlsfails (fault caught). Clean branch: suite passes. Mutation delta onProfileMigration.cs: 28.0% -> 59.2%, posted above.Manifest + raw run outputs: https://gist.github.com/anagnorisis2peripeteia/f78f8b91812cb8d3b6009be38c42b2df