Skip to content

test(macos): make Swift guard tests able to fail (ToolTier golden, SC006, credential/app-state, token savings label) - #1512

Merged
Dumbris merged 4 commits into
mainfrom
fix/issues-b15-macos-tray-tests
Oct 5, 2026
Merged

Dumbris merged 4 commits into
mainfrom
fix/issues-b15-macos-tray-tests

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Four macOS Swift test guards now fail when their assertions break, catching actual bugs in contract compliance and UI consistency. Tests drive through the app's real wiring, use decoy records to prevent false negatives, and slice UI code before matching shared components.

Fixed Issues

  • Follow-ups from Spec 108-l parity/docs review (#1456) #1458 (credential never in AppState): Drive the credential test through AppState's deferred client source, matching the sheet's real wiring. Test now verifies POST went through the app and that secrets never land in UserDefaults or AppState dumps.

  • Follow-ups from post-merge Sol 6.1 review of Spec 108/109 PRs #1451 (Token Savings label reuse): Slice the tokenSavingsSection of HomeView before asserting the shared estimate label exists, eliminating false positives from unrelated label matches elsewhere in the file.

  • Final done-check residuals (Spec 108/109 UX effort) #1466 (SC006 filter combinations): Feed the test a superset of ids (all combinations' ids interleaved as decoys), forcing the filter to actually select the right records instead of passing because the input was built from the expected output. Test now asserts folding does not drop or reorder records.

  • ToolTier golden contract (follow-up): New test pins all Go tier spellings (read, write, destructive, unannotated) as known Swift enum cases, preventing silent .unknown fallback if a tier is missing.

Tests Updated

  • ClientBindingModelTests.swift: Rewired credential test to use AppState's deferred source and a stub HTTP client; added offline-connection test case.
  • HomeTokenSavingsBadgeTests.swift: Extracts tokenSavingsSection before checking the label is reused.
  • ProfilesEnumsLabelsTests.swift: New testToolTierCoversTheGoTiers() pins wire spellings.
  • SC006RecordSetTests.swift: Builds decoy superset; verifies folding preserves order and both filter + display work correctly.

Review

Clean after 1 round(s).

Deferred finding:

  • glm:1.1 (low-deferred): The AppState-dump leg of assertClean (String(reflecting: appState).contains("mcp_cli_")) cannot fail. AppState is a plain Swift class, so String(reflecting:) renders only the type name and never its stored properties. The secret scan the change claims to run over AppState is therefore inert. — Noted; kept for its signal (tests the value-dump sources that DO matter).

Review Status

Folded in the deferred glm:1.1 fix (9167628): the AppState leg of assertClean now inspects stored values via Mirror so the secret scan can fail. Merged origin/main (no conflicts).

Closes #1458
Refs #1451
Refs #1466

…1466)

Pin ToolTier wire spellings, feed SC006 a decoy superset, drive the credential
test through AppState's deferred source, and slice the Token Savings card
before asserting the shared estimate label.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8d71f01
Status: ✅  Deploy successful!
Preview URL: https://323a85d1.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-issues-b15-macos-tray-te.mcpproxy-docs.pages.dev

View logs

@Dumbris
Dumbris enabled auto-merge (squash) October 5, 2026 13:15
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/issues-b15-macos-tray-tests

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (27 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-goG4R1G5.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 37315265359 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

… stored values

String(reflecting:) on a plain Swift class prints only the type name, so the
assertClean AppState leg could never fail. Walk the stored properties with a
recursive Mirror dump instead; verified it fails when a secret is seeded.
@Dumbris
Dumbris merged commit c4b1f2b into main Oct 5, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from Spec 108-l parity/docs review (#1456)

2 participants