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

refactor: codeflare sdk unit tests #702

Merged

Conversation

Bobbins228
Copy link
Contributor

@Bobbins228 Bobbins228 commented Oct 8, 2024

sort unit tests into individual files and made minor enhancements

Issue link

Closes: RHOAIENG-13847

What changes have been made

  • Refactored unit tests into separate files from unit_test.py
  • Updated get_ray_obj and get_aw_obj related helper functions (No more full RayCluster/AppWrapper yamls in a test file!!!)
  • Made minor enhancements to pre-existing unit tests
  • Merged all ClusterConfiguration related tests into one test that tests all parameters (instead of multiple smaller tests that test 1 or 2)
  • removed demo-tests.py and func-tests.py (I think these were initial test files which we have never used)

Verification steps

  • Create a shell with poetry shell
  • Install the CodeFlare SDK -> poetry install --with test,docs
  • Run all of the tests using coverage run -m --source=src pytest src/codeflare_sdk --ignore=src/codeflare_sdk/common/utils/unit_test_support.py
  • Check coverage with coverage report or coverage report -m | tail -1 | tail -c 4

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

@Bobbins228 Bobbins228 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2024
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 97.46479% with 27 lines in your changes missing coverage. Please review.

Project coverage is 93.99%. Comparing base (bff13a5) to head (3d5a99d).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...rc/codeflare_sdk/common/utils/unit_test_support.py 89.05% 15 Missing ⚠️
src/codeflare_sdk/ray/cluster/test_cluster.py 97.14% 6 Missing ⚠️
src/codeflare_sdk/ray/cluster/test_pretty_print.py 87.23% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #702      +/-   ##
==========================================
+ Coverage   91.30%   93.99%   +2.69%     
==========================================
  Files          23       36      +13     
  Lines        1299     2364    +1065     
==========================================
+ Hits         1186     2222    +1036     
- Misses        113      142      +29     

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

@Bobbins228 Bobbins228 changed the title [WIP] refactor: codeflare sdk unit tests refactor: codeflare sdk unit tests Oct 8, 2024
@Bobbins228 Bobbins228 removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 8, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2024
Copy link
Contributor

openshift-ci bot commented Oct 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KPostOffice

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 7694218 into project-codeflare:main Oct 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants