Provide APIs for testing the Scan tool Java APIs#56
Provide APIs for testing the Scan tool Java APIs#56gayaldassanayake merged 1 commit intoballerina-platform:mainfrom
Conversation
3c2d3fa to
f19ff63
Compare
f19ff63 to
3483076
Compare
3483076 to
2a93dd7
Compare
|
| } | ||
| } | ||
|
|
||
| // Setting up checkstyles |
There was a problem hiding this comment.
Let's remove these comments, they don't add value?
There was a problem hiding this comment.
Pull Request Overview
This PR exposes internal APIs and utilities in the scan tool to enable Java-based testing, refactors key classes for better test injection, and adds a dedicated test-utils module.
- Export internal and utils packages to the test module
- Refactor
ScanCmd,ProjectAnalyzer, and related classes to allow custom project loading and rule inspection - Add
scan-command-test-utilsmodule with test helpers and assertions
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scan-command/src/main/java/module-info.java | Export internal and utils packages to io.ballerina.scan.test |
| scan-command/src/main/java/io/ballerina/scan/internal/ScanCmd.java | Replace argList with projectPath, add constructor overloads, expose getProjectAnalyzer and getAllRules |
| scan-command/src/main/java/io/ballerina/scan/internal/ProjectAnalyzer.java | Make class public, add protected getScannerContext extension point |
| scan-command/src/main/java/io/ballerina/scan/internal/ReporterImpl.java | Change class and method visibilities to support subclassing in tests |
| scan-command-test-utils/src/main/java/module-info.java | Define new test module io.ballerina.scan.test |
| scan-command-test-utils/src/... | Add test utilities (TestScanCmd, TestProjectAnalyzer, ScanTestRunner, assertions, etc.) |
| build configuration and workflows | Bump Ballerina version, add test dependencies for ballerina-lang |
Comments suppressed due to low confidence (1)
scan-command-test-utils/src/main/java/module-info.java:1
- Add a
requires io.ballerina.projects;statement so classes referencingio.ballerina.projects.Projectcan compile under this module.
module io.ballerina.scan.test {
2a93dd7 to
1b001c2
Compare
1b001c2 to
a1c84a3
Compare
a1c84a3 to
36428d3
Compare
Provide test APIs Improve the APIs Restructure the APIs Add assertHasRule Fix spotbugs errors Fix failing tests Refactor the code
47e3da0 to
82c041f
Compare
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
============================================
- Coverage 87.57% 86.42% -1.16%
Complexity 308 308
============================================
Files 19 19
Lines 982 987 +5
Branches 153 151 -2
============================================
- Hits 860 853 -7
- Misses 64 76 +12
Partials 58 58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cf83349
into
ballerina-platform:main



Purpose
$ subject
Fixes #27
Approach
Check List