Skip to content

[WIP] Add test coverage #782

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

Open
wants to merge 17 commits into
base: 17.0
Choose a base branch
from
Open

[WIP] Add test coverage #782

wants to merge 17 commits into from

Conversation

shashikala1998
Copy link
Contributor

@shashikala1998 shashikala1998 commented Mar 16, 2025

Why is this change needed?

To add test coverages for;

  1. spp_custom_field
  2. spp_attendance
  3. spp_cycle_attendance_compliance

How was the change implemented?

New unit tests

Unit tests executed by the author

How to test manually

Related links

#779

@shashikala1998 shashikala1998 linked an issue Mar 16, 2025 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 96.34703% with 16 lines in your changes missing coverage. Please review.

Project coverage is 76.85%. Comparing base (60c70be) to head (abb57fd).
Report is 52 commits behind head on 17.0.

Files with missing lines Patch % Lines
...endance_compliance/tests/test_attendance_config.py 89.18% 8 Missing ⚠️
...pp_attendance/tests/test_attendance_controllers.py 91.17% 6 Missing ⚠️
spp_custom_field/tests/test_custom_field.py 98.37% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #782      +/-   ##
==========================================
+ Coverage   75.02%   76.85%   +1.82%     
==========================================
  Files         727      775      +48     
  Lines       19228    20656    +1428     
  Branches     2400     2521     +121     
==========================================
+ Hits        14426    15875    +1449     
+ Misses       4293     4211      -82     
- Partials      509      570      +61     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shashikala1998 there are no codes in spp_cycle_attendance_compliance test codes. Please check.

@kneckinator
Copy link
Contributor

@gonzalesedwin1123 can you please take a look at the latest changes from @shashikala1998 ?
Thanks!

@gonzalesedwin1123
Copy link
Member

Yes @kneckinator . I will check this today.

@kneckinator
Copy link
Contributor

Yes @kneckinator . I will check this today.

Great @gonzalesedwin1123 . Did you find anything or can this be merged?

@gonzalesedwin1123
Copy link
Member

gonzalesedwin1123 commented May 7, 2025

Yes @kneckinator . I will check this today.

Great @gonzalesedwin1123 . Did you find anything or can this be merged?

@kneckinator I just requested for changes from @shashikala1998 regarding the sonarqubecloud report.

@gonzalesedwin1123
Copy link
Member

Quality Gate Failed Quality Gate failed

Failed conditions 24 Security Hotspots 7.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@shashikala1998 can you fix these. I think this is important.

@gonzalesedwin1123 gonzalesedwin1123 self-requested a review May 7, 2025 00:26
Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shashikala1998 please check the sonarqubecloud report and make the necessary fixes. Thanks.

@kneckinator
Copy link
Contributor

kneckinator commented May 12, 2025

@shashikala1998 please check the sonarqubecloud report and make the necessary fixes. Thanks.

@shashikala1998 there are two main topics:

  • The duplicated lines in the tests; for instance, create a parametrised function to generate a attendance record in spp_cycle_attendance_compliance/tests/test_cycle_attendance.py
  • Use https in the event_data_source in the tests, to avoid false positives from the scan performed by SonarCloud

You should also change test.com to use either example.com, or any domain in the TLD .example. RFC 2606 has reserved this TLD for testing, so you can for instance use https://test.example instead of http://test.com

Copy link

@shashikala1998
Copy link
Contributor Author

@gonzalesedwin1123 @kneckinator sonarqubecloud reports issues are fixed and Quality gate passed

@kneckinator
Copy link
Contributor

@gonzalesedwin1123 @kneckinator sonarqubecloud reports issues are fixed and Quality gate passed

Thanks @shashikala1998 . Can you please take a final look @gonzalesedwin1123 ?

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.

Increase the test coverage of modules
3 participants