Skip to content

Conversation

@osoykan
Copy link
Collaborator

@osoykan osoykan commented Dec 9, 2025

implements #821

Copilot AI review requested due to automatic review settings December 9, 2025 16:00
@osoykan osoykan changed the title feat(#821): ktor works with any dependency provider, and also with kt… feat(#821): ktor works with any dependency provider, and also with ktor-di with auto detection Dec 9, 2025
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 flexible dependency injection support to Stove's Ktor testing module, allowing it to work with Koin, Ktor-DI, or custom DI frameworks. Previously, only Koin was supported. The implementation uses auto-detection based on classpath availability and provides an extensibility point for custom resolvers.

Key Changes:

  • Introduced DI abstraction layer with DependencyResolver type alias and DependencyResolvers object for auto-detection
  • Made Koin and Ktor-DI compileOnly dependencies to allow users to bring their preferred DI system
  • Created shared test fixtures and separate test modules for both Koin and Ktor-DI to validate the implementation

Reviewed changes

Copilot reviewed 19 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
starters/ktor/stove-ktor-testing-e2e/src/main/kotlin/com/trendyol/stove/testing/e2e/DependencyResolvers.kt New file defining resolver abstraction and implementations for Koin, Ktor-DI, and auto-detection
starters/ktor/stove-ktor-testing-e2e/src/main/kotlin/com/trendyol/stove/testing/e2e/KtorDiCheck.kt New utility for runtime classpath detection of DI frameworks
starters/ktor/stove-ktor-testing-e2e/src/main/kotlin/com/trendyol/stove/testing/e2e/KtorBridgeSystem.kt Updated to accept custom resolver with default auto-detection
starters/ktor/stove-ktor-testing-e2e/build.gradle.kts Changed Koin and Ktor-DI dependencies from implementation to compileOnly
starters/ktor/tests/ktor-test-fixtures/* New shared test fixtures module with common test domain and abstract test class
starters/ktor/tests/ktor-koin-tests/* New test module demonstrating Koin integration
starters/ktor/tests/ktor-di-tests/* New test module demonstrating Ktor-DI integration
settings.gradle.kts Added three new test modules to the build
gradle/libs.versions.toml Added ktor-server-di library reference
docs/release-notes/0.20.0.md Documented the new DI flexibility feature with usage examples
build.gradle.kts Excluded new test modules from API validation
starters/ktor/stove-ktor-testing-e2e/api/stove-ktor-testing-e2e.api Updated API signatures to reflect new resolver parameter

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

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 85.36585% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.65%. Comparing base (f874b55) to head (e50257f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../trendyol/stove/testing/e2e/DependencyResolvers.kt 47.05% 5 Missing and 4 partials ⚠️
.../trendyol/stove/testing/e2e/system/BridgeSystem.kt 50.00% 1 Missing and 1 partial ⚠️
...com/trendyol/stove/testing/e2e/KtorBridgeSystem.kt 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #937      +/-   ##
==========================================
+ Coverage   78.56%   78.65%   +0.09%     
==========================================
  Files         117      121       +4     
  Lines        3848     3926      +78     
  Branches      323      329       +6     
==========================================
+ Hits         3023     3088      +65     
- Misses        631      640       +9     
- Partials      194      198       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osoykan osoykan force-pushed the feat/ktor-di-flexibility branch from 553b01c to 3d1fb6f Compare December 9, 2025 16:26
@osoykan osoykan merged commit e50257f into main Dec 10, 2025
3 of 4 checks passed
@osoykan osoykan deleted the feat/ktor-di-flexibility branch December 10, 2025 08:30
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.

2 participants