### Install Peekie via mise Source: https://github.com/dodobrands/peekie/blob/main/README.md Use mise to install the peekie binary. ```bash mise use github:dodobrands/peekie ``` -------------------------------- ### Use PeekieSDK to Parse xcresult Source: https://github.com/dodobrands/peekie/blob/main/README.md Example usage of the PeekieSDK to initialize a report and access warnings, modules, and files. ```swift import PeekieSDK let report = try await Report(xcresultPath: URL(fileURLWithPath: "/path/to.xcresult")) // All warnings, anywhere in the bundle for issue in report.warnings { print("\(issue.type.rawValue): \(issue.message)") } // Files in a specific target let bonusesFiles = report.modules.first { $0.name == "Bonuses" }?.files ?? [] // Files without a known target (test-less targets, project-level issues) let untargeted = report.files.filter { $0.module == nil } ``` -------------------------------- ### JSON Output Format Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Example of the default JSON output structure for build warnings. ```json [ {"file": "Foo.swift", "line": 42, "column": 8, "type": "DeprecatedDeclaration", "message": "'oldFoo()' is deprecated: use bar()"}, {"file": "Bar.swift", "line": 12, "column": 4, "type": "ActorIsolatedCall", "message": "Main actor-isolated initializer cannot be called from outside the actor"}, {"file": "Calculator.swift", "line": 7, "column": 17, "type": "Swift Compiler Error", "message": "Some warning from Calculator"} ] ``` -------------------------------- ### Install Peekie for Claude Code Source: https://github.com/dodobrands/peekie/blob/main/README.md Commands to add and install the Peekie plugin within the Claude Code environment. ```bash /plugin marketplace add dodobrands/Peekie /plugin install peekie ``` -------------------------------- ### Get first error message Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md Retrieves only the message of the first error, useful for notifications. ```bash peekie errors Build.xcresult | jq -r '.[0].message // "no errors"' ``` -------------------------------- ### Build the project Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Compiles the Swift package. ```bash swift build ``` -------------------------------- ### Execute the CLI tool Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Runs the peekie command-line tool to list results from an .xcresult file. ```bash swift run peekie list path/to/tests.xcresult ``` -------------------------------- ### Configure Peekie for Cursor Source: https://github.com/dodobrands/peekie/blob/main/README.md Commands to clone the repository and symlink the rule file into a Cursor project. ```bash git clone https://github.com/dodobrands/Peekie.git ~/.peekie-plugin mkdir -p .cursor/rules ln -s ~/.peekie-plugin/agent/rules/peekie.mdc .cursor/rules/peekie.mdc ``` -------------------------------- ### Peekie CLI Subcommand Usage Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie/SKILL.md Overview of available subcommands and their respective arguments for processing xcresult files. ```bash peekie tests [--format json|list|sonar] default: list peekie warnings [--format json|list] default: json peekie errors [--format json|list] default: json peekie coverage [--format json|list] default: json peekie attachments --output-dir [--format json|list] default: json ``` -------------------------------- ### Run peekie warnings Source: https://github.com/dodobrands/peekie/blob/main/README.md Extract build warnings as a flat JSON array or human-readable list. ```bash peekie warnings Tests.xcresult # [ # {"file":"Foo.swift","line":42,"column":8,"type":"DeprecatedDeclaration","message":"'oldFoo()' is deprecated: use bar"}, # ... # ] # Group by type peekie warnings Tests.xcresult | jq 'group_by(.type) | map({type: .[0].type, count: length})' # Human-readable peekie warnings Tests.xcresult --format list # Foo.swift:42:8 [DeprecatedDeclaration] 'oldFoo()' is deprecated ``` -------------------------------- ### Synopsis for peekie tests Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Basic command structure for executing the tests subcommand. ```bash peekie tests [flags] ``` -------------------------------- ### Create an issue using the template Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Create an issue using the predefined template or interactively. ```bash gh issue create --template .github/ISSUE_TEMPLATE.md ``` ```bash gh issue create --fill ``` -------------------------------- ### Run peekie attachments Source: https://github.com/dodobrands/peekie/blob/main/README.md Export attachment payloads to a directory and generate a metadata JSON array. ```bash # Export every attachment in the bundle peekie attachments Tests.xcresult --output-dir ./attachments # [ # { # "qualifiedName": "ExamplesTests / ExampleSUITests / withAttachment()", # "name": "Calculation Result_0_.txt", # "exportedFileName": ".txt", # "path": "./attachments/.txt", # "contentType": "text/plain", # "isAssociatedWithFailure": false, # "repetitionNumber": 1 # }, # ... # ] # Only attachments from failing tests peekie attachments Tests.xcresult --output-dir ./attachments --include failure # A single test by identifier peekie attachments Tests.xcresult --output-dir ./attachments --test-id "ExamplesTests/ExampleSUITests/withAttachment()" # Human-readable peekie attachments Tests.xcresult --output-dir ./attachments --format list ``` -------------------------------- ### Create a pull request using the template Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Create a pull request using the predefined template or interactively. ```bash gh pr create --template .github/pull_request_template.md ``` ```bash gh pr create --fill ``` -------------------------------- ### Run peekie coverage command Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Basic usage of the peekie coverage command to extract data from an xcresult bundle. ```bash peekie coverage [flags] ``` -------------------------------- ### Peekie CLI Subcommands Source: https://github.com/dodobrands/peekie/blob/main/README.md Overview of available data-axis subcommands and their default formats. ```text peekie tests [--format json|list|sonar] default: list peekie warnings [--format json|list] default: json peekie errors [--format json|list] default: json peekie coverage [--format json|list] default: json peekie attachments --output-dir [--format json|list] default: json ``` -------------------------------- ### Run tests Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Executes the test suite, with options for running all tests or specific test methods. ```bash # Run all tests swift test # Run a specific test swift test --filter . ``` -------------------------------- ### Run peekie errors Source: https://github.com/dodobrands/peekie/blob/main/README.md Use as a build-failed gate by checking the error count. ```bash errors=$(peekie errors Tests.xcresult | jq 'length') [ "$errors" -gt 0 ] && exit 1 ``` -------------------------------- ### Command Synopsis Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Basic usage pattern for the peekie warnings command. ```bash peekie warnings [flags] ``` -------------------------------- ### Run peekie errors command Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md Basic usage of the peekie errors command with a required path to the .xcresult bundle. ```bash peekie errors [flags] ``` -------------------------------- ### peekie attachments command synopsis Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Basic command structure for extracting attachments from an xcresult bundle. ```bash peekie attachments --output-dir [flags] ``` -------------------------------- ### peekie warnings Source: https://github.com/dodobrands/peekie/blob/main/README.md Extracts build warnings from an xcresult bundle. ```APIDOC ## peekie warnings ### Description Retrieves a list of build warnings from the provided xcresult bundle. ### Usage `peekie warnings [--format json|list]` ### Parameters - **xcresult** (string) - Required - Path to the xcresult bundle. - **--format** (string) - Optional - Output format: json or list. Default: json. ``` -------------------------------- ### Generate per-module summary table Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Format the output into a tab-separated table for human-readable summaries. ```bash peekie coverage Tests.xcresult \ | jq -r '.modules[] | "\(.name)\t\(.coveredLines)/\(.totalLines)\t\((.coverage * 100 | floor))%"' ``` -------------------------------- ### Run peekie tests Source: https://github.com/dodobrands/peekie/blob/main/README.md Extract test results with status filtering and SonarQube export options. ```bash # Human-readable, all statuses peekie tests Tests.xcresult # Only failures and flaky tests peekie tests Tests.xcresult --include failure,mixed # JSON for a dashboard peekie tests Tests.xcresult --format json > tests.json # SonarQube generic test execution XML peekie tests Tests.xcresult --format sonar --tests-path Tests > sonar-tests.xml ``` -------------------------------- ### Run peekie coverage Source: https://github.com/dodobrands/peekie/blob/main/README.md Extract code coverage data in JSON or as a padded table. ```bash # JSON for a dashboard peekie coverage Tests.xcresult # {"coverage": 0.6234, "modules": [{"name":"Calculator","coverage":0.71,"files":[…]}, …]} # Total in one line peekie coverage Tests.xcresult | jq '.coverage' # 0.6234 # Padded table peekie coverage Tests.xcresult --format list # Calculator 71.6% (167/233) # StringUtils 84.0% (42/50) # total 62.3% ``` -------------------------------- ### Calculate coverage percentage Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Recipes for formatting the coverage percentage as an integer or with one decimal place using jq. ```bash peekie coverage Tests.xcresult | jq '.coverage * 100 | floor' ``` ```bash peekie coverage Tests.xcresult | jq '(.coverage * 1000 | floor) / 10' ``` -------------------------------- ### Sort modules by coverage Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Sort modules by their coverage percentage in ascending order. ```bash peekie coverage Tests.xcresult \ | jq '.modules | sort_by(.coverage) | .[] | {name, coverage, coveredLines, totalLines}' ``` -------------------------------- ### Dump all attachments to a directory Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Extracts every attachment found in the result bundle to a specified output directory. ```bash peekie attachments Tests.xcresult --output-dir "$CI_ARTIFACTS/attachments" ``` -------------------------------- ### Create a new feature branch Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Use these commands to synchronize with the main branch and create a new feature branch for development. ```bash git checkout main git fetch origin git pull git checkout -b your-branch-name ``` -------------------------------- ### peekie errors Source: https://github.com/dodobrands/peekie/blob/main/README.md Extracts build errors from an xcresult bundle. ```APIDOC ## peekie errors ### Description Retrieves a list of build errors from the provided xcresult bundle, useful for CI build-failed gates. ### Usage `peekie errors [--format json|list]` ### Parameters - **xcresult** (string) - Required - Path to the xcresult bundle. - **--format** (string) - Optional - Output format: json or list. Default: json. ``` -------------------------------- ### Lint and format code Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Commands for formatting the codebase and running strict linting checks. ```bash # Install (or update) toolchain mise install # Format the codebase in place swiftformat . # CI-equivalent strict checks (run before pushing) swiftformat --lint . swiftlint --strict ``` -------------------------------- ### Print first three errors Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md Extracts and formats the first three errors with file and line information. ```bash peekie errors Build.xcresult \ | jq -r '.[:3] | .[] | "\(.file):\(.line // "?"): \(.message)"' ``` -------------------------------- ### JSON output format Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md The default JSON output structure for build errors. ```json [ {"file": "AppDelegate.swift", "line": 87, "column": 5, "type": "Swift Compiler Error", "message": "Cannot find 'FooBar' in scope"}, {"file": "Network/Client.swift", "line": 154, "column": 12, "type": "Swift Compiler Error", "message": "Value of type 'URLSession' has no member 'asyncData'"} ] ``` -------------------------------- ### peekie attachments Source: https://github.com/dodobrands/peekie/blob/main/README.md Exports attachments from an xcresult bundle. ```APIDOC ## peekie attachments ### Description Exports XCTAttachment or Swift Testing attachments to a directory and emits metadata in JSON or list format. ### Usage `peekie attachments --output-dir [--test-id ] [--include ] [--format json|list]` ### Parameters - **xcresult** (string) - Required - Path to the xcresult bundle. - **--output-dir** (string) - Required - Directory to save exported attachments. - **--test-id** (string) - Optional - Filter by specific test identifier. - **--include** (string) - Optional - Comma-separated statuses to include. - **--format** (string) - Optional - Output format: json or list. Default: json. ``` -------------------------------- ### Gate CI on coverage threshold Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Use jq -e to exit with an error if the coverage falls below a specified threshold. ```bash if ! peekie coverage Tests.xcresult | jq -e '.coverage >= 0.70' >/dev/null; then cov=$(peekie coverage Tests.xcresult | jq -r '(.coverage * 1000 | floor) / 10') echo "Coverage below 70% (got ${cov}%)" >&2 exit 1 fi ``` -------------------------------- ### Generate SonarQube report Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Exports test results into a format compatible with SonarQube analysis. ```bash peekie tests Tests.xcresult --format sonar --tests-path ./Sources > sonar-tests.xml ``` -------------------------------- ### List attachment file paths Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Outputs only the file paths of the attachments, useful for piping into other utilities like cp or scp. ```bash peekie attachments Tests.xcresult --output-dir /tmp/att | jq -r '.[].path' ``` -------------------------------- ### Filter files by coverage Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md Select files within a specific module that have coverage below a certain percentage. ```bash peekie coverage Tests.xcresult \ | jq '.modules[] | select(.name == "Networking") | .files[] | select(.coverage < 0.5)' ``` -------------------------------- ### peekie coverage Source: https://github.com/dodobrands/peekie/blob/main/README.md Extracts code coverage data from an xcresult bundle. ```APIDOC ## peekie coverage ### Description Retrieves code coverage metrics from the provided xcresult bundle. ### Usage `peekie coverage [--format json|list]` ### Parameters - **xcresult** (string) - Required - Path to the xcresult bundle. - **--format** (string) - Optional - Output format: json or list. Default: json. ``` -------------------------------- ### Update Report initialization Source: https://github.com/dodobrands/peekie/blob/main/MIGRATION.md The Report initializer now includes an includeTests flag to optionally skip test result processing. ```swift // 4.x public init( xcresultPath: URL, includeCoverage: Bool = true, includeWarnings: Bool = true ) async throws // 5.0 public init( xcresultPath: URL, includeCoverage: Bool = true, includeWarnings: Bool = true, includeTests: Bool = true // new ) async throws ``` -------------------------------- ### peekie tests Source: https://github.com/dodobrands/peekie/blob/main/README.md Extracts test results from an xcresult bundle with support for status filtering and SonarQube export. ```APIDOC ## peekie tests ### Description Retrieves test results from an xcresult file. Supports filtering by status and exporting to different formats including JSON and SonarQube XML. ### Usage `peekie tests [--format json|list|sonar] [--include ] [--include-device-details] [--tests-path ] [--attachments skip|export] [--attachments-to ]` ### Parameters - **xcresult** (string) - Required - Path to the xcresult bundle. - **--format** (string) - Optional - Output format: json, list, or sonar. Default: list. - **--include** (string) - Optional - Comma-separated statuses to include. - **--tests-path** (string) - Required if format is sonar - Path for SonarQube test execution. - **--attachments** (string) - Optional - Attachment handling: skip or export. - **--attachments-to** (string) - Optional - Directory for exported attachments. ``` -------------------------------- ### Diagnose SonarQube Pathing Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Command to list qualified test names for debugging SonarQube file-correlation issues. ```bash peekie tests --format json | jq -r '.modules[].tests[].qualifiedName' | head ``` -------------------------------- ### Export Test Attachments Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Command to export test attachments to a specific directory, followed by the resulting JSON structure for an attachment. ```bash peekie tests Tests.xcresult --format json --attachments export --attachments-to /tmp/att ``` ```json { "qualifiedName": "ExamplesTests / ExampleSUITests / withAttachment()", "status": "success", "durationMs": 8.34, "attachments": [ { "name": "Calculation Result.txt", "exportedFileName": "67676173-…-396.txt", "path": "/tmp/att/67676173-…-396.txt", "contentType": "text/plain", "isAssociatedWithFailure": false, "repetitionNumber": 1 } ] } ``` -------------------------------- ### Include device details in test results Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Appends device information to test names, useful for distinguishing tests run across multiple simulators. ```bash peekie tests Tests.xcresult --format json --include-device-details true ``` -------------------------------- ### Export all test data to a single CI artifact directory Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie/SKILL.md Generates JSON reports for tests, warnings, errors, coverage, and attachments in a single directory. ```bash ARTIFACTS=$CI_ARTIFACTS peekie tests Build.xcresult --format json > "$ARTIFACTS/tests.json" peekie warnings Build.xcresult --format json > "$ARTIFACTS/warnings.json" peekie errors Build.xcresult --format json > "$ARTIFACTS/errors.json" peekie coverage Build.xcresult --format json > "$ARTIFACTS/coverage.json" peekie attachments Build.xcresult --output-dir "$ARTIFACTS/attachments" --format json > "$ARTIFACTS/attachments.json" ``` -------------------------------- ### Fail CI on build errors Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md A script to check for errors and fail the CI process if any are found. ```bash errors=$(peekie errors Build.xcresult | jq 'length') if [ "$errors" -gt 0 ]; then peekie errors Build.xcresult --format list exit 1 fi ``` -------------------------------- ### Add PeekieSDK Dependency Source: https://github.com/dodobrands/peekie/blob/main/README.md Swift Package Manager dependency declaration for integrating PeekieSDK. ```swift .package(url: "https://github.com/dodobrands/Peekie.git", from: "5.0.0") ``` -------------------------------- ### Count Total Warnings Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Calculates the total number of warnings in the result bundle. ```bash peekie warnings Build.xcresult | jq 'length' ``` -------------------------------- ### Fail CI on build errors and report coverage Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie/SKILL.md Extracts build metrics from an xcresult bundle and triggers a failure exit code if errors are detected. ```bash errors=$(peekie errors Build.xcresult | jq 'length') warnings=$(peekie warnings Build.xcresult | jq 'length') coverage=$(peekie coverage Build.xcresult | jq '.coverage * 100 | floor') echo "errors=$errors warnings=$warnings coverage=${coverage}%" if [ "$errors" -gt 0 ]; then peekie errors Build.xcresult --format list exit 1 fi ``` -------------------------------- ### JSON output structure Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-coverage/SKILL.md The default JSON output format providing overall coverage and hierarchical module/file data. ```json { "coverage": 0.6234, "modules": [ { "name": "Calculator", "coverage": 0.71, "coveredLines": 167, "totalLines": 233, "files": [ {"name": "Calculator.swift", "path": "/.../Calculator.swift", "coverage": 0.71, "coveredLines": 167, "totalLines": 233} ] }, { "name": "Networking", "coverage": 0.42, "coveredLines": 84, "totalLines": 200, "files": [ {"name": "Client.swift", "path": "/.../Networking/Client.swift", "coverage": 0.50, "coveredLines": 50, "totalLines": 100}, {"name": "Endpoint.swift", "path": "/.../Networking/Endpoint.swift", "coverage": 0.34, "coveredLines": 34, "totalLines": 100} ] } ] } ``` -------------------------------- ### Run unused code detection Source: https://github.com/dodobrands/peekie/blob/main/AGENTS.md Executes Periphery to scan for unused code. ```bash periphery scan --skip-build --strict ``` -------------------------------- ### Group Warnings by Type Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Aggregates warnings by their type and counts occurrences for each. ```bash peekie warnings Build.xcresult | jq 'group_by(.type) | map({type: .[0].type, count: length})' ``` -------------------------------- ### Report Model Structure in 5.0 Source: https://github.com/dodobrands/peekie/blob/main/MIGRATION.md The updated Report struct uses centralized storage for files and modules, providing keyed lookups for coverage, suites, and tests. ```swift public struct Report { // existing public let files: [File] public let modules: [Module] public let coverage: Double? // new in 5.0 — keyed by Module.name public let coverageByModule: [String: Coverage] public let suitesByModule: [String: [Module.Suite]] public let rootLevelTestsByModule: [String: Set] // new in 5.0 — sugared lookups over the above public func files(in module: Module) -> [File] public func coverage(of module: Module) -> Coverage? public func suites(in module: Module) -> [Module.Suite] public func rootLevelTests(in module: Module) -> Set public func warnings(in module: Module) -> [File.Issue] public func errors(in module: Module) -> [File.Issue] } ``` -------------------------------- ### Export test attachments Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Extracts test attachments to a specified directory and filters for tests containing attachments. ```bash peekie tests Tests.xcresult --format json --attachments export --attachments-to /tmp/att \ | jq '.modules[].tests[] | select(.attachments)' ``` -------------------------------- ### Generate failure summary Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Formats failed test names and messages for use in messaging platforms like Slack or Telegram. ```bash peekie tests Tests.xcresult --include failure --format json \ | jq -r '.modules[].tests[] | "- " + .qualifiedName + ": " + (.message // "")' ``` -------------------------------- ### Group errors by file Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-errors/SKILL.md Aggregates error counts per file using jq. ```bash peekie errors Build.xcresult | jq 'group_by(.file) | map({file: .[0].file, count: length})' ``` -------------------------------- ### Filter manifest to failures Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Extracts all attachments but filters the resulting manifest JSON to only include those associated with failures. ```bash peekie attachments Tests.xcresult --output-dir /tmp/att --include failure ``` -------------------------------- ### Count #warning Markers Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Counts the number of #warning directives by filtering for Swift Compiler Error types. ```bash # Count of #warning markers (since all Swift Compiler Error entries are markers) peekie warnings Build.xcresult | jq 'map(select(.type == "Swift Compiler Error")) | length' ``` -------------------------------- ### JSON Output Format Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md The default JSON output provides a flat array of attachment metadata, sorted by qualifiedName. ```json [ { "qualifiedName": "ExamplesTests / ExampleSUITests / failureWithAttachment()", "name": "Failure context.txt", "exportedFileName": "DA864376-…-FDD5.txt", "path": "/tmp/att/DA864376-…-FDD5.txt", "contentType": "text/plain", "isAssociatedWithFailure": false, "repetitionNumber": 1, "configurationName": "Test Scheme Action" }, { "qualifiedName": "ExamplesTests / ExampleSUITests / withAttachment()", "name": "Calculation Result.txt", "exportedFileName": "67676173-…-396.txt", "path": "/tmp/att/67676173-…-396.txt", "contentType": "text/plain", "isAssociatedWithFailure": false, "repetitionNumber": 1, "configurationName": "Test Scheme Action" } ] ``` -------------------------------- ### Default JSON Output Structure Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md The default flat structure for test results, providing a qualified name, status, and duration for each test. ```json { "modules": [ { "name": "ExamplesTests", "files": [], "tests": [ {"qualifiedName": "ExamplesTests / 2 + 3 = 5", "status": "success", "durationMs": 11.99}, {"qualifiedName": "ExamplesTests / ExampleSUITests / failure()", "status": "failure", "durationMs": 8.34, "message": "Expected 5.0 but got 6.0"}, {"qualifiedName": "ExamplesTests / OuterSuite / InnerSuite / DeeplyNestedSuite / deeplyNestedSuccess()", "status": "success", "durationMs": 1.2} ] } ] } ``` -------------------------------- ### Count failures across modules Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Calculates the total number of failed tests across all modules. ```bash peekie tests Tests.xcresult --include failure --format json \ | jq '[.modules[].tests[]] | length' ``` -------------------------------- ### Define Issue and Location models Source: https://github.com/dodobrands/peekie/blob/main/MIGRATION.md The Issue struct now includes an optional Location property, which provides line and column information for reported issues. ```swift public struct Issue: Equatable, Sendable { public let type: IssueType public let message: String public let location: Location? // new in 5.0 } public struct Location: Equatable, Sendable, Codable { public let startLine: Int public let startColumn: Int? public let endLine: Int? public let endColumn: Int? } ``` -------------------------------- ### Extract attachments per-failure Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Organizes attachments into subdirectories based on the failing test ID using a helper script or an inline loop. ```bash scripts/extract-failure-attachments.sh Tests.xcresult /tmp/failed-attachments ``` ```bash OUT=/tmp/failed-attachments mkdir -p "$OUT" peekie tests Tests.xcresult --format json --include failure \ | jq -r '.modules[].tests[].qualifiedName | split(" / ") | .[1:] | join("/")' \ | while read -r id; do slug=$(printf '%s' "$id" | tr '/()' '___' | tr -s '_') mkdir -p "$OUT/$slug" peekie attachments Tests.xcresult --output-dir "$OUT/$slug" --test-id "$id" --format json >/dev/null done ``` -------------------------------- ### Save failure attachments as CI artifacts Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie/SKILL.md Iterates through failing tests to extract attachments into a dedicated directory, stripping module prefixes from test IDs. ```bash OUT="$CI_ARTIFACTS/failed-attachments" mkdir -p "$OUT" peekie tests Build.xcresult --format json --include failure \ | jq -r '.modules[].tests[].qualifiedName | split(" / ") | .[1:] | join("/")' \ | while read -r id; do peekie attachments Build.xcresult --output-dir "$OUT" --test-id "$id" --format json >/dev/null done ``` -------------------------------- ### Extract attachments for a specific test Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-attachments/SKILL.md Targets a single test case by its identifier to extract associated attachments. ```bash peekie attachments Tests.xcresult \ --output-dir /tmp/att \ --test-id "ExampleSUITests/failure()" ``` -------------------------------- ### Triage #warning Markers Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Separates #warning markers from real warnings based on the Swift Compiler Error type. ```bash peekie warnings Build.xcresult | jq ' group_by(.type == "Swift Compiler Error") | map({kind: (if .[0].type == "Swift Compiler Error" then "#warning markers" else "real warnings" end), count: length}) ' ``` -------------------------------- ### Filter Deprecation Warnings Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-warnings/SKILL.md Extracts and formats deprecation warnings with file and line information. ```bash peekie warnings Build.xcresult \ | jq -r 'map(select(.type == "DeprecatedDeclaration")) | .[] | "\(.file):\(.line // "?"): \(.message)"' ``` -------------------------------- ### Filter broken tests Source: https://github.com/dodobrands/peekie/blob/main/agent/skills/peekie-tests/SKILL.md Extracts failed and mixed test results from an xcresult bundle and outputs them as JSON. ```bash peekie tests Tests.xcresult --include failure,mixed --format json | jq '.modules[].tests' ``` -------------------------------- ### Add errors property to File struct Source: https://github.com/dodobrands/peekie/blob/main/MIGRATION.md The File struct now exposes an errors array, mirroring the existing warnings property. ```swift public struct File: Hashable { public let warnings: [Issue] public let errors: [Issue] // new in 5.0 ... } ``` -------------------------------- ### IssueType Enum Migration Source: https://github.com/dodobrands/peekie/blob/main/MIGRATION.md IssueType transitioned from a closed String-backed enum to an open enum supporting additional diagnostic types and Codable conformance. ```swift // 4.x public enum IssueType: String, Equatable, Sendable { case buildWarning = "Swift Compiler Warning" } // 5.0 public enum IssueType: Equatable, Sendable { case swiftCompilerWarning case swiftCompilerError case deprecatedDeclaration case noUsage case unknown(String) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.