Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewmodelscope.launch shows partial code coverage in sonarqube #2351

Closed
yuvaraj119 opened this issue Oct 29, 2020 · 3 comments
Closed

viewmodelscope.launch shows partial code coverage in sonarqube #2351

yuvaraj119 opened this issue Oct 29, 2020 · 3 comments
Labels

Comments

@yuvaraj119
Copy link

At the function getDetails(str) viewModelScope.launch it shows partially covered in sonarqube.
Not able to figure out how to cover.

It shows 1 of 3, so there are 3 cases that have to be covered in JUnit.

Assumption:
1 case - it can be the success of the launch - do(green)
2 case - it can be a failure - how to make viewModelScope.launch fail in JUnit?
3 case -?

function getDetails(string)=viewModelScope.launch {
//some code
}

Code in images links:-
https://i.stack.imgur.com/X43OU.png
https://i.stack.imgur.com/QSmdy.png

StackOverflow link - https://stackoverflow.com/questions/64594799/viewmodelscope-launch-shows-partial-code-coverage-in-sonarqube

kotlinVersion = '1.4.10'
coroutinesVersion = '1.3.0'
Jacoco - 0.8.6
sonarqube - 7.8

@qwwdfsad
Copy link
Member

Sorry, we are not familiar with sonarqube. It's better to ask on sonarqube mailing-list/stackoverflow as it seems to be a coverage-specific issue, not kotlinx.coroutines-related one

@albka1986
Copy link

albka1986 commented Mar 17, 2021

@yuvaraj119
Have you found any answer? Your StackOverflow page doesn't exist anymore

@yuvaraj119
Copy link
Author

@yuvaraj119
Have you found any answer? Your StackOverflow page doesn't exist anymore

Yes by updating jacoco to latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants