Optimize unit test workflow with selective module testing #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Overview
This PR implements intelligent test execution that only runs tests for modules that have changes or depend on changed modules, significantly reducing CI execution time while maintaining comprehensive test coverage.
📋 Problem Solved
Currently, the unit test workflow runs > Task :buildlogic:checkKotlinGradlePluginConfigurationErrors SKIPPED
[Incubating] Problems report is available at: file:///Users/mpohl/work/tidal-sdk/tidal-sdk-android/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
4 actionable tasks: 4 up-to-date which executes tests for ALL modules regardless of what changed. This leads to:
🎯 Solution
Implemented a smart change detection system that:
🔍 Change Detection
📊 Dependency Analysis
⚡ Smart Execution
📁 Files Added
Core Scripts
�[0;32m📋 Test tasks to run:�[0m :auth:apps:demo:test :auth:test :bom:test :common:test :eventproducer:apps:demo:test :eventproducer:test :player:apps:demo:test :player:test :tidalapi:apps:demo:test :tidalapi:test
�[0;34m🧪 Running affected tests...�[0m - Convenience wrapper for easy execution
�[1;33mTest 1: No changes�[0m
�[0;32m✓ PASS�[0m: Got expected output** - Test suite for validation
Workflows
🧪 Testing
The script has been tested with various scenarios:
🎁 Benefits
⏱️ Performance Improvements
🛡️ Reliability
🔧 Developer Experience
📖 Usage Examples
In GitHub Actions
Local Development
�[0;34m🔍 Detecting affected modules...�[0m
�[0;32m📋 Test tasks to run:�[0m :auth:apps:demo:test :auth:test :bom:test :common:test :eventproducer:apps:demo:test :eventproducer:test :player:apps:demo:test :player:test :tidalapi:apps:demo:test :tidalapi:test
�[0;34m🧪 Running affected tests...�[0m
:auth:apps:demo:test :auth:test :bom:test :common:test :eventproducer:apps:demo:test :eventproducer:test :player:apps:demo:test :player:test :tidalapi:apps:demo:test :tidalapi:test
🔄 Module Dependencies
The system understands the project's dependency structure:
🧪 Validation
This change will significantly improve CI efficiency while maintaining the same level of test coverage and reliability.