Skip to content

Coverage - #27

Merged
NullPointerDepressiveDisorder merged 7 commits into
mainfrom
coverage
Dec 19, 2025
Merged

Coverage#27
NullPointerDepressiveDisorder merged 7 commits into
mainfrom
coverage

Conversation

@NullPointerDepressiveDisorder

Copy link
Copy Markdown
Owner

This pull request introduces a comprehensive test suite for the core model logic of the app, adds Bitrise CI configuration with automated code coverage reporting, and improves the Xcode project and GitHub Actions workflow setup to better support testing and CI integration. The changes are grouped into three main themes: testing infrastructure, CI/CD improvements, and project configuration updates.

Testing Infrastructure

  • Added two new test files, GestureModelsTests.swift and TouchModelsTests.swift, providing extensive unit tests for gesture, touch, and user preference models. [1] [2]
  • Integrated a new test target, MiddleDragTests, into the Xcode project, including proper groupings, build phases, and configuration for unit testing. [1] [2] [3] [4] [5] [6] [7] [8] [9]

CI/CD Improvements

  • Added a bitrise.yml configuration for Bitrise CI, enabling automated build, test, code coverage generation (with lcov export), and upload to Codecov.
  • Updated the Xcode scheme (MiddleDrag.xcscheme) to enable code coverage and register the new test target for test actions.

Project Configuration and Workflow Updates

  • Improved the GitHub Actions workflow for Objective-C/Xcode by restricting builds to the main branch, renaming steps for clarity, and switching the build configuration from Release to Debug for quicker feedback. [1] [2] [3]

These updates collectively enhance the project's reliability, testability, and CI/CD integration, ensuring higher code quality and easier maintenance.

Configure Codecov with:
- 70-100% coverage range target
- 5% threshold for project coverage
- 80% patch coverage target (informational)
- Ignore patterns for test files and app entry points
Create MiddleDragTests target with 22 unit tests:
- GestureModelsTests: 10 tests covering GestureState,
  GestureConfiguration, and UserPreferences
- TouchModelsTests: 12 tests covering MTPoint,
  TouchState, and TrackedFinger

Tests validate core model behavior including:
- Distance and midpoint calculations
- State machine transitions
- Velocity sensitivity calculations
- Touch tracking logic
- Add test target with build configurations
- Configure test host to run against MiddleDrag.app
- Enable code coverage in scheme
- Add testable reference to scheme's TestAction
- Rename workflow to 'Build & Test'
- Switch to Debug configuration for coverage data
- Add test step with code coverage enabled
- Convert coverage to lcov format
- Upload results to Codecov via codecov-action@v5

Requires CODECOV_TOKEN secret to be configured.
Configure Bitrise as primary CI with:
- primary workflow: build, test, coverage upload to Codecov
- deploy workflow: release/distribution builds
- Xcode 16.2 on M1 machines
- DerivedData caching for faster builds

Requires CODECOV_TOKEN secret in Bitrise.
Bitrise now handles primary CI with tests and coverage.
GitHub Actions provides quick build verification for PRs only.
Copilot AI review requested due to automatic review settings December 19, 2025 02:27
@NullPointerDepressiveDisorder NullPointerDepressiveDisorder added the enhancement New feature or request label Dec 19, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request establishes a comprehensive testing and CI/CD infrastructure for the MiddleDrag project. It introduces unit tests for core model logic, configures Bitrise CI for automated testing with code coverage reporting to Codecov, and streamlines the GitHub Actions workflow for faster build validation. The changes lay the foundation for maintaining code quality through automated testing while keeping the existing GitHub Actions workflow focused on quick build checks.

Key changes:

  • Added comprehensive unit tests for GestureModels and TouchModels with 100% coverage of model logic
  • Configured Bitrise CI pipeline with automated test execution, coverage generation (lcov format), and Codecov integration
  • Updated GitHub Actions workflow to run Debug builds on PRs targeting main, with clearer step naming

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
codecov.yml Configures Codecov with appropriate coverage targets, ignores test files and app entry points
bitrise.yml Defines primary workflow for build/test/coverage and deploy workflow for releases using Xcode 16.2.x
MiddleDragTests/TouchModelsTests.swift Comprehensive tests for MTPoint geometry, TouchState enums, and TrackedFinger behavior
MiddleDragTests/GestureModelsTests.swift Thorough tests for GestureState, GestureConfiguration (including velocity boost logic), and UserPreferences
MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme Enables code coverage and registers the MiddleDragTests target for test actions
MiddleDrag.xcodeproj/project.pbxproj Adds MiddleDragTests target with proper configuration, file references, and build phases
.github/workflows/objective-c-xcode.yml Simplifies workflow to PR-only triggers, renames to "Build Check", switches to Debug configuration

Comment thread .github/workflows/objective-c-xcode.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
@NullPointerDepressiveDisorder
NullPointerDepressiveDisorder merged commit 0e2b54b into main Dec 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants