refactor(12/12): add snapshot test fixtures and benchmarks#330
Open
cameroncooke wants to merge 2 commits intorefactor/manifests-config-docsfrom
Open
refactor(12/12): add snapshot test fixtures and benchmarks#330cameroncooke wants to merge 2 commits intorefactor/manifests-config-docsfrom
cameroncooke wants to merge 2 commits intorefactor/manifests-config-docsfrom
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Fixture has un-normalized username causing cross-environment test failures
- Added normalization for USER, ALTERNATE_OWNER, INSTALL_OWNER, and VERSION_INFO_BUILDER build settings to replace usernames with , and updated the fixture file accordingly.
- ✅ Fixed: Developer team ID committed in fixture file
- Added normalization for DEVELOPMENT_TEAM build setting to replace team ID with , and updated the fixture file to remove the hardcoded team ID.
Or push these changes by commenting:
@cursor push d89a7eafb2
Preview (d89a7eafb2)
diff --git a/src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt b/src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
--- a/src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
+++ b/src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
@@ -15,7 +15,7 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
- ALTERNATE_OWNER = cameroncooke
+ ALTERNATE_OWNER = <redacted>
ALTERNATIVE_DISTRIBUTION_WEB = NO
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
ALWAYS_SEARCH_USER_PATHS = NO
@@ -156,7 +156,7 @@
DEVELOPER_TOOLS_DIR = /Applications/Xcode-26.4.0.app/Contents/Developer/Tools
DEVELOPER_USR_DIR = /Applications/Xcode-26.4.0.app/Contents/Developer/usr
DEVELOPMENT_LANGUAGE = en
- DEVELOPMENT_TEAM = BR6WD3M6ZD
+ DEVELOPMENT_TEAM = <redacted>
DIAGNOSE_MISSING_TARGET_DEPENDENCIES = YES
DIFF = /usr/bin/diff
DOCUMENTATION_FOLDER_PATH = CalculatorApp.app/en.lproj/Documentation
@@ -293,7 +293,7 @@
INSTALL_DIR = /tmp/CalculatorApp.dst/Applications
INSTALL_GROUP = staff
INSTALL_MODE_FLAG = u+w,go-w,a+rX
- INSTALL_OWNER = cameroncooke
+ INSTALL_OWNER = <redacted>
INSTALL_PATH = /Applications
INSTALL_ROOT = /tmp/CalculatorApp.dst
IPHONEOS_DEPLOYMENT_TARGET = 17.0
@@ -568,7 +568,7 @@
UNLOCALIZED_RESOURCES_FOLDER_PATH_SHALLOW_BUNDLE_NO = CalculatorApp.app/Resources
UNLOCALIZED_RESOURCES_FOLDER_PATH_SHALLOW_BUNDLE_YES = CalculatorApp.app
UNSTRIPPED_PRODUCT = NO
- USER = cameroncooke
+ USER = <redacted>
USER_APPS_DIR = <HOME>/Applications
USER_LIBRARY_DIR = <HOME>/Library
USE_DYNAMIC_NO_PIC = YES
@@ -579,7 +579,7 @@
VALID_ARCHS = arm64 arm64e armv7 armv7s
VERBOSE_PBXCP = NO
VERSIONPLIST_PATH = CalculatorApp.app/version.plist
- VERSION_INFO_BUILDER = cameroncooke
+ VERSION_INFO_BUILDER = <redacted>
VERSION_INFO_FILE = CalculatorApp_vers.c
VERSION_INFO_STRING = "@(#)PROGRAM:CalculatorApp PROJECT:CalculatorApp-1"
WATCHOS_DEPLOYMENT_TARGET = 26.4
diff --git a/src/snapshot-tests/normalize.ts b/src/snapshot-tests/normalize.ts
--- a/src/snapshot-tests/normalize.ts
+++ b/src/snapshot-tests/normalize.ts
@@ -47,6 +47,9 @@
const ACQUIRED_USAGE_ASSERTION_TIME_REGEX =
/(^\s*)\d{2}:\d{2}:\d{2}( {2}Acquired usage assertion\.)$/gm;
const BUILD_SETTINGS_PATH_REGEX = /^( {6}PATH = ).+$/gm;
+const BUILD_SETTINGS_USER_REGEX =
+ /^( {6}(?:USER|ALTERNATE_OWNER|INSTALL_OWNER|VERSION_INFO_BUILDER) = ).+$/gm;
+const BUILD_SETTINGS_DEVELOPMENT_TEAM_REGEX = /^( {6}DEVELOPMENT_TEAM = ).+$/gm;
const TRAILING_WHITESPACE_REGEX = /[ \t]+$/gm;
function sortLinesInBlock(text: string, marker: RegExp): string {
@@ -130,6 +133,8 @@
normalized = normalized.replace(TARGET_DEVICE_IDENTIFIER_REGEX, '$1<UUID>');
normalized = normalized.replace(BUILD_SETTINGS_PATH_REGEX, '$1<PATH>');
+ normalized = normalized.replace(BUILD_SETTINGS_USER_REGEX, '$1<redacted>');
+ normalized = normalized.replace(BUILD_SETTINGS_DEVELOPMENT_TEAM_REGEX, '$1<redacted>');
normalized = normalized.replace(CODEX_ARG0_PATH_REGEX, '<HOME>/.codex/tmp/arg0/codex-arg0<ARG0>');
normalized = normalized.replace(ACQUIRED_USAGE_ASSERTION_TIME_REGEX, '$1<TIME>$2');
normalized = normalized.replace(This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
Outdated
Show resolved
Hide resolved
src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
Show resolved
Hide resolved
c179927 to
f33bc8d
Compare
55a323e to
22247c9
Compare
22247c9 to
785bdd9
Compare
f33bc8d to
3b9be04
Compare
3b9be04 to
daa650e
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit daa650e. Configure here.
src/snapshot-tests/__fixtures__/project-discovery/show-build-settings--success.txt
Show resolved
Hide resolved
083f816 to
f5391c3
Compare
daa650e to
672e575
Compare
f5391c3 to
b6e35ad
Compare
672e575 to
ebee70a
Compare
This was referenced Apr 9, 2026
Collaborator
Author
4 tasks
ebee70a to
ed126b6
Compare
0497670 to
dc62323
Compare
91087af to
25e9218
Compare
dc62323 to
3cf09d1
Compare
25e9218 to
d954223
Compare
3cf09d1 to
1bc80ad
Compare
d954223 to
66f1dca
Compare
8dfeb16 to
d9a8caa
Compare
66f1dca to
7583cb0
Compare
d9a8caa to
6ea4df8
Compare
7583cb0 to
1c849e2
Compare
The show-build-settings fixture had hardcoded username and UID values that would cause test failures on other developer machines. Added normalizer rules for ALTERNATE_OWNER, INSTALL_OWNER, USER, VERSION_INFO_BUILDER, and UID build settings.
6ea4df8 to
86b945d
Compare
1c849e2 to
42de996
Compare
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.



Summary
This is PR 12 of 12, the final PR in the stacked series that decouples the rendering pipeline from MCP transport. Depends on PR 11.
Adds the snapshot test suite and performance benchmarks that validate the entire rendering pipeline end-to-end. These are large in line count but are almost entirely test fixtures (expected output files) and benchmark scripts.
Snapshot test suite (159 files, ~5700 lines)
The snapshot test infrastructure captures the rendered output of tool invocations and compares against expected fixtures. This provides regression protection for the rendering pipeline -- any change to event formatting, diagnostic grouping, or output ordering will be caught by a fixture mismatch.
Test harness (
src/snapshot-tests/):harness.ts: Core test runner that invokes tools with mock executors and captures rendered outputfixture-io.ts: Reads/writes fixture files, handles normalization (timestamps, paths, UUIDs)flowdeck-fixture-io.ts: Flowdeck-specific fixture handlingnormalize.ts: Output normalization for stable comparisons across environmentsresource-harness.ts: Resource-specific snapshot testingFixtures: Expected output files for each tool covering success, error, and edge case scenarios. These serve as living documentation of what each tool's output looks like.
Benchmarks (~3300 lines)
Performance benchmarks for the rendering pipeline and xcodebuild parsing:
These benchmarks establish baselines and can be run in CI to catch performance regressions.
Note for reviewers
This PR is large by line count but low in conceptual complexity. The fixture files are auto-generated expected outputs. The benchmark scripts are straightforward timing loops. The meaningful code is the ~500 lines of test harness infrastructure.
Stack navigation
Test plan
npx vitest runpasses -- snapshot tests match expected fixturesnpx vitest run --config vitest.snapshot.config.tsruns snapshot suite specifically