[
https://issues.apache.org/jira/browse/KARAF-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606490#comment-17606490
]
ASF GitHub Bot commented on KARAF-7552:
---------------------------------------
awrb commented on PR #1621:
URL: https://github.com/apache/karaf/pull/1621#issuecomment-1250715906
@jbonofre Ah I missed the itests somehow. They're certainly more useful
than the tests with mocked FeaturesService. There are a few similar tests that
I looked at before adding the ones in the PR (testing the command with mocks
rather than pax-exam), e.g.
`org.apache.karaf.bundle.command.ListServicesTest`
`org.apache.karaf.features.command.ListFeaturesCommandTest`
`org.apache.karaf.config.command.EditCommandTest`
so based on these I thought this approach for testing commands is OK.
It seems to me that it's still useful to have tests like that, to check if
the command is calling the proper service methods, passing the correct
arguments etc. If you are working on the commands, they're also easier to run
than pax-exam and can act as a preliminary test. But it's best for the
maintainers to decide.
Another question: is some code coverage tool used in the project? I only
found jacoco in tooling/karaf-maven-plugin. Maybe there is sonarqube on jenkins
or something? I'd like to use something to check where more test cases can be
supplied.
> Improving test coverage for feature commands
> --------------------------------------------
>
> Key: KARAF-7552
> URL: https://issues.apache.org/jira/browse/KARAF-7552
> Project: Karaf
> Issue Type: Improvement
> Components: karaf
> Reporter: Aleksy Wróblewski
> Priority: Major
> Labels: newbie, pull-request-available
>
> There is only a single test in org.apache.karaf.features.command:
> ListFeaturesCommandTest. It would be good to add tests for other commands,
> like repo:add etc.
>
> [will add a pull request shortly]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)