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

[SDK] Add more unit tests for TrainingClient APIs - get_job_pods #2175

Conversation

YosiElias
Copy link
Contributor

What this PR does / why we need it:
New unit test for get_job_pods function

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #2161

Checklist:

  • Docs included if any changes are user facing

@coveralls
Copy link

coveralls commented Jul 18, 2024

Pull Request Test Coverage Report for Build 10026748617

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 35.358%

Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob_controller.go 8 80.48%
Totals Coverage Status
Change from base Build 9943726142: -0.07%
Covered Lines: 4372
Relevant Lines: 12365

💛 - Coveralls

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @YosiElias 🎉
/cc @tenzen-y @droctothorpe @deepanker13

@@ -87,10 +103,10 @@ def __init__(self, kind) -> None:
self.kind = kind


test_data = [
test_data_for_create_job = [
Copy link
Member

Choose a reason for hiding this comment

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

Let's call it test_data_create_job ?

@@ -149,14 +165,14 @@ def __init__(self, kind) -> None:
),
(
"valid flow",
{"job": create_job(), "namespace": "test"},
{"job": create_job(), "namespace": TEST_NAME},
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to change it since we don't verify the namespace name in the test ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, we don't really verify this namespace name, but just for clarity I think it better using variable instead of the same string again and again. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good.

assert out == expected_output
except Exception as e:
assert type(e) is expected_output
print("test execution complete")
Copy link
Member

Choose a reason for hiding this comment

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

Please add a new line.

Signed-off-by: yelias <[email protected]>
@andreyvelich
Copy link
Member

/ok-to-test

@andreyvelich
Copy link
Member

/rerun-all

@andreyvelich
Copy link
Member

Thank you for this great contribution @YosiElias 🎉
/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

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

@google-oss-prow google-oss-prow bot merged commit f55a91d into kubeflow:master Jul 22, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDK] Add more unit tests for TrainingClient APIs
3 participants