Skip to content

Conversation

@khmyznikov
Copy link
Contributor

This pull request introduces a static initialization step to the PeekFilePreviewTests class to ensure the correct test settings are present before tests run. The main change is the addition of a static constructor that creates or updates the settings.json file with predefined settings, including setting the activation shortcut to Ctrl+Space.

Test setup improvements:

  • Added a static constructor to PeekFilePreviewTests that calls a new FixSettingsFileBeforeTests method, ensuring the necessary settings file exists and is properly configured before any tests execute.
  • Implemented FixSettingsFileBeforeTests to create the required directory and write a settings.json file with specific test configuration, including setting the activation shortcut to Ctrl+Space and other test-relevant properties.

@khmyznikov khmyznikov linked an issue Oct 31, 2025 that may be closed by this pull request
@khmyznikov khmyznikov requested a review from lei9444 October 31, 2025 20:49
@khmyznikov khmyznikov added Product-Peek Refers to Peek Powertoys Area-Tests issues that relate to tests labels Oct 31, 2025
@lei9444
Copy link
Contributor

lei9444 commented Nov 4, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@khmyznikov
Copy link
Contributor Author

var enabledModules = new Dictionary<string, bool>();
foreach (var module in property.Value.EnumerateObject())
{
// Set module to true if in modulesToEnable array, otherwise false

Check failure

Code scanning / check-spelling

Forbidden Pattern Error

, otherwise matches a line_forbidden.patterns entry: ", [Oo]therwise\\b". (forbidden-pattern)
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors and Warnings Count
❌ forbidden-pattern 1
⚠️ ignored-expect-variant 3

See ❌ Event descriptions for more information.

These words are not needed and should be removed cabstr CIBUILD djwsxzxb icf installscopeperuser ksa registryroot regroot rtm suntimes TARGETDIR utm

Forbidden patterns 🙅 (1)

In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves.

These forbidden patterns matched content:

Should be ; otherwise or . Otherwise

https://study.com/learn/lesson/otherwise-in-a-sentence.html

, [Oo]therwise\b
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@khmyznikov
Copy link
Contributor Author

I've broke it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Tests issues that relate to tests Product-Peek Refers to Peek Powertoys

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check and Fix Failed UI Tests - Peek

3 participants