Convert LocalTests_SettingsModel into UnitTests_SettingsModel #10781

Open
opened 2026-01-31 02:30:08 +00:00 by claunia · 0 comments
Owner

Originally created by @carlos-zamora on GitHub (Sep 25, 2020).

Description of the new feature/enhancement

#7667 introduces the TerminalSettingsModel by ripping out a large chunk of TerminalApp. All of the testing was thrown into LocalTests_SettingsModel. Moving them into a unit tests project like TermApp.UnitTests allows us to run these in CI.

About 20/33 tests are able to be moved into a UnitTests-like project with no modifications.
2/33 can be moved with minor modifications (see below).
The remaining 11/33 require a larger refactor (this issue tracks this).

Proposed technical implementation details (optional)

SettingsModelLocalTests::KeyBindingsTests

  • All of these tests fail because they need to construct a KeyChord. KeyChord is in the TerminalControl namespace.

SettingsModelLocalTests::CommandTests

  • TestResourceKeyName and TestLayerOnAutogeneratedName fail because they need access to the resource loader.

SettingsModelLocalTests::SerializationTests

  • The tests below fail because they need to import defaults.json. Which results in hitting the two cases above.
    • TestReorderWithNullGuids
    • TestReorderingWithoutGuid
    • TestLayeringNameOnlyProfiles
    • TestExplodingNameOnlyProfiles
    • TestDontLayerGuidFromUserDefaults
    • ValidateKeybindingsWarnings
  • TestCommandsAndKeybindings doesn't import defaults.json, but fails again because it hits the two cases above.
  • The two tests that can be fixed fairly easily are ValidateLegacyGlobalsWarning and TestTrailingCommas. They don't really need a dependency on importing defaults.json.
Originally created by @carlos-zamora on GitHub (Sep 25, 2020). # Description of the new feature/enhancement #7667 introduces the TerminalSettingsModel by ripping out a large chunk of TerminalApp. All of the testing was thrown into LocalTests_SettingsModel. Moving them into a unit tests project like TermApp.UnitTests allows us to run these in CI. About 20/33 tests are able to be moved into a UnitTests-like project with no modifications. 2/33 can be moved with minor modifications (see below). The remaining 11/33 require a larger refactor (this issue tracks this). # Proposed technical implementation details (optional) `SettingsModelLocalTests::KeyBindingsTests` - All of these tests fail because they need to construct a `KeyChord`. `KeyChord` is in the `TerminalControl` namespace. `SettingsModelLocalTests::CommandTests` - `TestResourceKeyName` and `TestLayerOnAutogeneratedName` fail because they need access to the resource loader. `SettingsModelLocalTests::SerializationTests` - The tests below fail because they need to import defaults.json. Which results in hitting the two cases above. - `TestReorderWithNullGuids` - `TestReorderingWithoutGuid` - `TestLayeringNameOnlyProfiles` - `TestExplodingNameOnlyProfiles` - `TestDontLayerGuidFromUserDefaults` - `ValidateKeybindingsWarnings` - `TestCommandsAndKeybindings` doesn't import defaults.json, but fails again because it hits the two cases above. - The two tests that can be fixed fairly easily are `ValidateLegacyGlobalsWarning` and `TestTrailingCommas`. They don't really need a dependency on importing defaults.json.
claunia added the Issue-TaskProduct-TerminalArea-CodeHealth labels 2026-01-31 02:30:08 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10781