Skip to content

Add unit tests for the config#35

Merged
marinofelipe merged 28 commits intomainfrom
unit-tests
Oct 27, 2025
Merged

Add unit tests for the config#35
marinofelipe merged 28 commits intomainfrom
unit-tests

Conversation

@marinofelipe
Copy link
Contributor

@marinofelipe marinofelipe commented Oct 26, 2025

  • Unit tests the config, including the default rules validation against a fixture package
  • Enable SPMGraphLintInput memberwise init
  • Fix default lint rules to use the injected module definitions. i.e., isLiveModule

Also

  • Enable Strict Concurrency
  • Bump SPM to 6.2 and min supported Swift version to 6.1
  • Update CI to build and test for both Xcode 16.4 and Xcode 26.0.1

@marinofelipe marinofelipe self-assigned this Oct 26, 2025
@marinofelipe marinofelipe requested a review from a team as a code owner October 26, 2025 11:41
Copilot AI review requested due to automatic review settings October 26, 2025 11:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit tests for the SPMGraphConfig functionality, validates the default lint rules against a fixture package, and fixes issues with how default lint rules use injected module definitions.

Key Changes:

  • Adds unit tests for all three default lint rules (liveModuleLiveDependency, baseOrInterfaceModuleLiveDependency, unusedDependencies)
  • Creates a fixture package structure to validate lint rules against real package scenarios
  • Fixes default lint rules to properly use injected isLiveModule predicates instead of hardcoded property access

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spmgraph.xctestplan Registers the new test target in the test plan
Tests/SPMGraphDescriptionInterfaceTests/SPMGraphConfigTests.swift Comprehensive unit tests for config and all lint rules
Tests/SPMGraphDescriptionInterfaceTests/Fixtures/Package+Fixture.swift Helper function to load the fixture package for testing
Tests/SPMGraphDescriptionInterfaceTests/Fixtures/PackageFixture/Package.swift Fixture package definition with various module dependency scenarios
Tests/SPMGraphDescriptionInterfaceTests/Fixtures/PackageFixture/Sources/* Fixture module implementations demonstrating various dependency patterns
Tests/SPMGraphDescriptionInterfaceTests/Fixtures/PackageFixture/Tests/BaseModuleTests/* Fixture test target
Sources/SPMGraphDescriptionInterface/SPMGraphConfigInterface.swift Fixes lint rules to use injected predicates and makes Error enum Equatable
Sources/SPMGraphLint/SPMGraphLint.swift Makes SPMGraphLintInput Equatable and exposes memberwise initializer
Package.swift Adds new test target with fixture resources
.swiftpm/xcode/xcshareddata/xcschemes/spmgraph-Package.xcscheme Updates Xcode scheme with test plan and test targets
Tests/Fixtures/Package/* Removes old fixture package (replaced by new structure)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@roveabruno roveabruno left a comment

Choose a reason for hiding this comment

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

o homi não para

@marinofelipe marinofelipe merged commit d9dbfeb into main Oct 27, 2025
6 checks passed
@marinofelipe marinofelipe deleted the unit-tests branch October 27, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants