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

Added sonar exclusions/inclusions for tests #2581

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Sep 5, 2023

🚀 🚀 Pull Request

Impact

  • Build Config

Description

The sonar reporting was counting test files in overall code to be covered by tests. This excludes test-related files from the coverage reporting.

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.10% ⚠️

Comparison is base (6cd78c7) 82.07% compared to head (e2a8517) 81.97%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2581      +/-   ##
==========================================
- Coverage   82.07%   81.97%   -0.10%     
==========================================
  Files         224      224              
  Lines       24502    24502              
==========================================
- Hits        20110    20086      -24     
- Misses       4392     4416      +24     
Flag Coverage Δ
unittests 81.97% <ø> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nvoxland nvoxland force-pushed the sonar_file_inclusions branch from 1ebfb20 to e09c3e3 Compare September 6, 2023 18:26
@nvoxland
Copy link
Contributor Author

nvoxland commented Sep 6, 2023

I created a temp.py and test_temp.py file:

def temp_testing_logic():
    return 3

def untested_logic():
    return 5
from deeplake.core.temp import temp_testing_logic


def test_func():
    assert temp_testing_logic() == 3

and with the sonar config it correctly reported 75% of the temp.py file as being tested vs. 25% of the combined test_temp.py + temp.py files like was previously reported.

@nvoxland nvoxland force-pushed the sonar_file_inclusions branch from af3c056 to e2a8517 Compare September 6, 2023 20:58
@nvoxland nvoxland requested review from artgish and levongh September 6, 2023 20:59
@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nvoxland nvoxland merged commit d563ee8 into main Sep 8, 2023
12 of 14 checks passed
@nvoxland nvoxland deleted the sonar_file_inclusions branch September 8, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants