Skip to content

test: Adds unit tests#1

Merged
rozd merged 4 commits intomasterfrom
feature/tests
Apr 11, 2026
Merged

test: Adds unit tests#1
rozd merged 4 commits intomasterfrom
feature/tests

Conversation

@rozd
Copy link
Copy Markdown
Owner

@rozd rozd commented Apr 11, 2026

This pull request introduces significant improvements to the project's continuous integration and release automation, and adds comprehensive new unit tests for core Faketooth components. The main changes include replacing and enhancing CI workflows, automating semantic versioning and release generation, and adding robust test coverage for characteristics and descriptors. Some redundant or outdated tests were removed or refactored.

CI/CD Workflow Improvements:

  • Added a new .github/workflows/ci.yml workflow for building, testing (with code coverage), and uploading coverage reports to Codecov, running on macos-15. This replaces the previous, simpler Swift workflow and adds coverage reporting and artifact upload.
  • Introduced .github/workflows/release.yml, a new workflow for automated releases. It analyzes commit messages using the Conventional Commits spec, determines the appropriate version bump (major/minor/patch), generates a changelog, tags the release, and publishes it using GitHub CLI.
  • Removed the old .github/workflows/swift.yml workflow, which only handled basic build and test steps, in favor of the new, more comprehensive CI workflow.

Test Suite Enhancements:

  • Added FaketoothCharacteristicTest.swift with extensive tests for FaketoothCharacteristic, covering initialization, value production/handling, service association, notification state, and properties.
  • Added FaketoothDescriptorTest.swift with comprehensive tests for FaketoothDescriptor, including initialization, value production/handling, characteristic association, and data handling.
  • Added CBCentralManagerTest+Fallbacks.swift to test fallback behavior to CoreBluetooth when simulation is disabled, ensuring real CoreBluetooth methods are called and no crashes occur.

Test Refactoring and Cleanup:

  • Removed a now-redundant fallback test from CBCentralManagerTest.swift, as this logic is now covered in the new dedicated fallbacks test file.
  • Minor improvement in FaketoothPeripheralTest.swift to ensure expectations are properly waited for after writing a value.

rozd and others added 4 commits June 4, 2021 11:35
Fix build errors preventing tests from compiling on macOS: remove UIKit
import, rewrite broken fallback tests with ObjC selector conflicts, and
clean up MockPeripheral/MockCentralManager. Fix incomplete
testWriteValueForCharacteristic that was missing writeValue call. Add
comprehensive tests for service discovery, notifications, write types,
peripheral properties, advertisement data, and new test suites for
FaketoothCharacteristic, FaketoothService, FaketoothDescriptor, and
FaketoothSettings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the old swift.yml with a modern CI workflow that builds, tests
with ObjC code coverage instrumentation, and uploads results to Codecov.
Add a release workflow that auto-creates GitHub releases with semantic
versioning based on Conventional Commits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rozd rozd merged commit ee40a55 into master Apr 11, 2026
@rozd rozd deleted the feature/tests branch April 11, 2026 11:58
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