Skip to content

test: add SPM + Xcode-app integration harnesses for the a11y-scan plugin#31

Open
Crash0v3rrid3 wants to merge 1 commit into
mainfrom
chore/tests-spm-xcode-integration
Open

test: add SPM + Xcode-app integration harnesses for the a11y-scan plugin#31
Crash0v3rrid3 wants to merge 1 commit into
mainfrom
chore/tests-spm-xcode-integration

Conversation

@Crash0v3rrid3

Copy link
Copy Markdown
Collaborator

What

Adds a tests/ folder with two consumer harnesses that integrate this repo's a11y-scan command plugin (via a path dependency on the repo root, ../..) and run accessibility scans over sample sources containing intentional issues.

tests/
├── README.md
├── spm/          # SwiftPM package consumer
└── xcode-app/    # Xcode iOS app (XcodeGen)

tests/spm/ — SwiftPM consumer

  • Declares the AccessibilityDevTools dependency and invokes the command plugin via swift package plugin … scan (scripts/run-a11y-scan.sh).
  • Sample SwiftUI views with intentional a11y issues; an XCTest unit test plus a credential-gated end-to-end scan test (RUN_A11Y_SCAN=1).
  • The plugin is intentionally not attached to a target's plugins: array — a11y-scan is a command plugin (not build-tool), and attaching it makes swift build fail with "Plugin is declared with the buildTool capability…".

tests/xcode-app/ — Xcode app

  • An iOS app described by an XcodeGen project.yml, so the generated .xcodeproj is gitignored.
  • Runs the scan from a pre-compile build phase (the official Xcode integration), backed by a minimal Package.swift scan driver. Unit-test target included. ENABLE_USER_SCRIPT_SANDBOXING disabled so the scan can write ~/.cache.

Both harnesses skip/no-op without BROWSERSTACK_USERNAME / BROWSERSTACK_ACCESS_KEY, so builds and tests stay green.

Verification

  • tests/spm: swift build ✅, swift test ✅ (unit test passes, scan test skips by default); swift package plugin --list shows 'scan' (plugin 'a11y-scan' in package 'AccessibilityDevTools').
  • tests/xcode-app: project.yml validates as YAML; scan driver resolves and exposes the plugin; both shell scripts pass bash -n.
  • ⚠️ Not run in this environment: xcodegen generate + xcodebuild test (xcodegen/Xcode simulator unavailable) and a live scan (needs BrowserStack creds). Generate and run locally to validate on your toolchain.

🤖 Generated with Claude Code

Adds a tests/ folder with two consumer harnesses that integrate this repo's a11y-scan command plugin (path dependency on the repo root) and run accessibility scans over sample sources with intentional issues:

- tests/spm/: a SwiftPM package that declares the AccessibilityDevTools dependency and invokes the command plugin via 'swift package plugin … scan' (scripts/run-a11y-scan.sh). Includes an XCTest unit test plus a credential-gated end-to-end scan test. Verified: swift build + swift test pass and the plugin is discoverable. The plugin is intentionally NOT placed in a target's plugins: array — it is a command (not build-tool) plugin, and attaching it breaks swift build.

- tests/xcode-app/: an iOS app described by an XcodeGen project.yml that runs the scan from a pre-compile build phase (the official Xcode integration), backed by a minimal Package.swift scan driver. Includes a unit-test target. project.yml validates as YAML and the scan driver resolves + exposes the plugin; the generated .xcodeproj was not built in this headless environment.

Both harnesses no-op/skip without BrowserStack credentials so builds and tests stay green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Crash0v3rrid3 Crash0v3rrid3 requested a review from a team as a code owner June 18, 2026 13:50
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.

1 participant