test-coverage

How to make “sourceDirectories” public in Jacoco report generation?

久未见 提交于 2021-02-16 20:32:10
问题 I was following this post to setup Jacoco code coverage for my project. But I am facing a error while writing the task to generate the report. Gradle Task task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) { reports { xml.enabled = true html.enabled = true } def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*'] def debugTree = fileTree(dir: "$project.buildDir/intermediates

Coverage.py warning: No data was collected. (no-data-collected)

佐手、 提交于 2020-04-04 10:37:27
问题 I am trying to find the coverage using coverage module for a django project but gets "Coverage.py warning: No data was collected. (no-data-collected)". My project folder has src and tests folders. When I run coverage run -m pytest && coverage report It produces a report with 100% coverage with the list of files inside the tests folder. Whereas when I run coverage run --source=src -m pytest && coverage report it says Coverage.py warning: No data was collected. (no-data-collected) No data to

Chutzpah coverage result smaller than 100% (due to private methods?)

时光怂恿深爱的人放手 提交于 2020-01-14 02:08:08
问题 I use Chutzpah to test my JavaScript test coverage. Here is an example for the coverage result when I run a single test file referenceFigureEdit.spec.js : I would expect the coverage to be 100% but it is only 91.07%. Clicking on the first line I can inspect my tested code in detail. Lines that are "not covered by the test" are highlighted: Question A : How can I tell Chutzpah that those methods have actually been executed or tell Chutzpah to not include those lines in the coverage result? Are

Configure coverage.py to use no migrations

我们两清 提交于 2020-01-05 04:31:27
问题 I am using Django Test Without Migrations to make my unit tests faster and I run the tests the following way: python manage.py test --nomigrations It significantly improved the speed. I want to do the same with PyCharm and coverage.py in order to take advantage of visuals PyCharm creates. I tried to add this to .coveragerc: [run] omit = */migrations/* But it turns out that it affects only reports. How can I do this? 回答1: Assuming you have professional version with django support: Click on

Jacoco code coverage in Android Studio with flavors

微笑、不失礼 提交于 2019-12-31 12:24:07
问题 I've been trying to run Jacoco test coverage for quiet some time now. I've tried several possible solutions reported in these topics: Android test code coverage with JaCoCo Gradle plugin How do I get a jacoco coverage report using Android gradle plugin 0.10.0 or higher? Im running the tests in a emulatated device using genymotion. Here is what i added to build.gradle: apply plugin: 'jacoco' android{ jacoco { version "0.7.1.201405082137" } buildTypes{ debug{ testCoverageEnabled = true } } }

Oauth Model Concern Test Coverage Stubs

允我心安 提交于 2019-12-31 05:40:34
问题 I am trying to figure out the best way to reach 100% test coverage on this class. I have outlined my full spec and I am hoping someone can point me in the right direction. My assumption is stubbing the Oauth2 request would do this, but I can not seem to make that work. I'm using Rails 4. Spec RSpec.describe 'AppOmniAuthentication', type: :concern do let(:klass) { User } let(:user) { create(:user) } let(:user_oauth_json_response) do unfiltered_oauth_packet = load_json_fixture('app_omni

$ionicPopup.show buttons onTap function not getting coverage in Angular Jasmine Unit Test

走远了吗. 提交于 2019-12-25 01:53:08
问题 When I call the outOfMvp() function in my unit test spec file, everything inside the function is getting coverage except for the onTap function. I was wondering how to get coverage in my unit test for the button's onTap function which is in a JSON object being passed in $ionicPopup.show() method? Here is the function in the js file: function outOfMvp(data) { environmentConfig.isScanDataReadValid = false; popup = $ionicPopup.show({ title: kioskConstants.POPUP_WORDING.OUT_OF_MVP_RETURN.title,

sonarqube test coverage with istanbul : No coverage property. Skip Sensor

北慕城南 提交于 2019-12-24 07:37:05
问题 I'm trying to output some test coverage (lcov) reports from istanbul into sonarqube to analyse our test coverage using thoughtworks GO. There is a coverage/html folder being output but sonarqube reports the following error No coverage property. Skip Sensor. Here's my properties file, what am I missing ? sonar.projectKey=transformers.allspark.ui sonar.projectName=Transformers Allspark UI sonar.projectVersion=1.0 sonar.host.url=https://sonarqube-security.test.ctmers.io sonar.sources=. sonar