Skip to content

ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191

Open
juliusknorr wants to merge 3 commits into
mainfrom
claude/test-coverage-github-actions-qd7p5y
Open

ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191
juliusknorr wants to merge 3 commits into
mainfrom
claude/test-coverage-github-actions-qd7p5y

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Gets CI actually running for the project and fixes a crash uncovered along the way.

  • Run unit tests on CI — new Tests workflow runs the IOCNotesUnitTests suite via xcodebuild test on a macos-15 runner (newest installed Xcode selected dynamically) for pushes and PRs to main. Skips package plugin validation, disables parallel testing for deterministic runs, and dumps the test summary and crash backtraces from the .xcresult bundle on failure. Also drops the stale iOCNotesTests testable from the shared scheme.
  • Revive SwiftLint + add Dependabot — the lint workflow was named .swiftlint.yml, which GitHub Actions ignores (leading dot), so the check never ran; renamed to swiftlint.yml. Added .github/dependabot.yml for SwiftPM and GitHub Actions updates.
  • Fix markdown editor crashMarkdownTextStorage.processEditing trapped the whole test suite with "String index is out of bounds" via String.nsRange(from:). Hardened range conversion to validate indices, clamp the edited location, and skip formatting on conversion failure; test suite now measures ranges in UTF-16 length.

@juliusknorr juliusknorr force-pushed the claude/test-coverage-github-actions-qd7p5y branch from 6d97c00 to 471300b Compare July 14, 2026 08:37
juliusknorr and others added 3 commits July 14, 2026 10:46
Add a Tests workflow that runs the IOCNotesUnitTests suite via
`xcodebuild test` on a macos-15 runner for pushes and pull requests to
main, selecting the newest installed Xcode dynamically.

- Pass -skipPackagePluginValidation so the embedded SwiftLint build tool
  plugin is trusted automatically in headless CI.
- Disable parallel testing so runs are deterministic and fatal errors are
  attributable.
- On failure, extract the test-results summary and crash backtraces from
  the .xcresult bundle so the real cause is visible in the build log.

Also remove the stale `iOCNotesTests` testable from the shared iOCNotes
scheme; that target no longer exists and would break `xcodebuild test`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The SwiftLint workflow was named `.swiftlint.yml`; GitHub Actions ignores
workflow files whose names begin with a dot, so the lint check never ran.
Rename it to `swiftlint.yml` so it is discovered and executed.

Add `.github/dependabot.yml` to keep Swift Package Manager dependencies and
the GitHub Actions used in our workflows up to date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
…ndices

MarkdownTextStorage.processEditing crashed the whole test suite with
"String index is out of bounds" (signal trap) via String.nsRange(from:),
which force-unwrapped samePosition(in:) and ran utf16.distance on indices
that may not belong to the current backing string.

- nsRange(from:): validate the range lies within the string and return an
  empty NSNotFound range instead of trapping on foreign/stale indices.
- processEditing: clamp the edited location to the string length and
  intersect the formatting range with the full range, skipping formatting
  when the line conversion fails.
- Stabilize the markdown test suite: measure ranges in UTF-16 length (what
  NSTextStorage uses) rather than grapheme count.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr juliusknorr force-pushed the claude/test-coverage-github-actions-qd7p5y branch from 471300b to f22c443 Compare July 14, 2026 08:48
@juliusknorr juliusknorr requested review from i2h3 and mpivchev July 14, 2026 08:49
@juliusknorr juliusknorr added the bug Something isn't working label Jul 14, 2026
@mpivchev

Copy link
Copy Markdown
Collaborator

Hi @juliusknorr, thanks :) Could you reproduce this crash?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants