[Repo Assist] test(tray): add WindowsFactAttribute; skip DPAPI test on non-Windows#265
Merged
shanselman merged 1 commit intomasterfrom May 5, 2026
Conversation
SettingsManager_ProtectsElevenLabsApiKeyForStorage calls ProtectSettingSecret, which intentionally throws PlatformNotSupportedException on non-Windows (DPAPI is Windows-only). The test had no platform guard, so it produced a spurious failure on every Linux CI run. Adds WindowsFactAttribute following the same pattern as IntegrationFactAttribute: a custom FactAttribute subclass that sets Skip automatically when the test runs on a non-Windows platform. Applies it to the one DPAPI test. The test continues to run and assert fully on Windows CI (windows-latest). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 4, 2026
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.
🤖 This is an automated pull request from Repo Assist.
Summary
Adds
WindowsFactAttribute— a custom xUnitFactAttributethat automatically skips the test on non-Windows platforms — and applies it to the one Tray test that calls the Windows Data Protection API (DPAPI).Problem
SettingsManager_ProtectsElevenLabsApiKeyForStoragecallsSettingsManager.ProtectSettingSecret, which intentionally throwsPlatformNotSupportedExceptionon non-Windows:The test had no platform guard, so it caused a spurious failure (not a skip) on every Linux run:
Fix
Adds
WindowsFactAttributefollowing the exact same pattern as the existingIntegrationFactAttribute:Replaces
[Fact]with[WindowsFact]on the DPAPI test. On Windows CI (windows-latest), the test runs and asserts fully. On Linux the test is skipped rather than failing.Related
This is a companion to #(PR for canvas fix) which fixed the two pre-existing failures in
OpenClaw.Shared.Tests(also Linux cross-platform issues). Together these make the full test suite clean on Linux.Test Status
OpenClaw.Shared.TestsOpenClaw.Tray.Tests./build.ps1was not run (Linux environment). This change only touches test infrastructure — no production source files modified.