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

chore: add intg tests to resource_pool.go #9199

Merged
merged 10 commits into from
May 13, 2024
Merged

Conversation

carolinaecalderon
Copy link
Contributor

@carolinaecalderon carolinaecalderon commented Apr 18, 2024

Ticket

RM-201

Description

Add tests to resource_pool.go for exported functions on kubernetesResourcePool. These tests run on a minikube cluster that circleCI spins up before running all master intg tests.

Test Plan

See attached test.

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@cla-bot cla-bot bot added the cla-signed label Apr 18, 2024
Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 32ea2d8
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6638f8270a71900008731b5f
😎 Deploy Preview https://deploy-preview-9199--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.24%. Comparing base (efbcdee) to head (7637063).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9199      +/-   ##
==========================================
+ Coverage   45.14%   45.24%   +0.09%     
==========================================
  Files        1230     1230              
  Lines      154572   154572              
  Branches     2405     2405              
==========================================
+ Hits        69786    69932     +146     
+ Misses      84591    84445     -146     
  Partials      195      195              
Flag Coverage Δ
backend 42.04% <ø> (+0.28%) ⬆️
harness 64.07% <ø> (ø)
web 36.06% <ø> (ø)

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

see 6 files with indirect coverage changes

@carolinaecalderon carolinaecalderon marked this pull request as ready for review April 30, 2024 16:38
@carolinaecalderon carolinaecalderon requested review from a team as code owners April 30, 2024 16:38
@carolinaecalderon carolinaecalderon changed the base branch from main to stoksc/feat/pods2jobs May 6, 2024 15:35
@carolinaecalderon carolinaecalderon requested a review from a team as a code owner May 6, 2024 15:35
@carolinaecalderon carolinaecalderon changed the base branch from stoksc/feat/pods2jobs to stoksc/feat/kubernetesjobs May 6, 2024 15:35
Copy link
Contributor

@stoksc stoksc left a comment

Choose a reason for hiding this comment

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

i think this is a fine start but most of the tests are too shallow to be meaningfully effective. e.g., i'd like the max slots test to actually check jobs exceeding max slots get queued, i'd like test allocate/release to actually start the allocation it gets, etc -- and i'd like to have a lot more asserts about the external system (k8s) state while they are ongoing. i approving this (modulo anything i've commented that you can easily fix) and we can try to fill the tests out on top of my pods->jobs pr.

in trying to make these tests more effective, i think it would be useful to run these tests in isolation and look at code coverage to see what paths are getting hit.

master/internal/rm/kubernetesrm/resource_pool_intg_test.go Outdated Show resolved Hide resolved
master/internal/rm/kubernetesrm/resource_pool_intg_test.go Outdated Show resolved Hide resolved
master/internal/rm/kubernetesrm/resource_pool_intg_test.go Outdated Show resolved Hide resolved
master/internal/rm/kubernetesrm/resource_pool_intg_test.go Outdated Show resolved Hide resolved
Name: uuid.NewString(),
BlockedNodes: []string{uuid.NewString(), uuid.NewString()},
}
rp.AllocateRequest(allocReq)
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this test would be a lot more useful if it started the resources it gets and makes some asserts about the state of the kubernetes cluster. but i can add that onto my pr since im changing some of this fundementally.

@carolinaecalderon carolinaecalderon requested review from a team as code owners May 9, 2024 20:32
@carolinaecalderon carolinaecalderon requested review from EmilyBonar and jgongd and removed request for a team May 9, 2024 20:32
Copy link

cla-bot bot commented May 9, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @determined-ci, @djanicekpach, @ShreyaLnuHpe on file. In order for us to review and merge your code, please start the CLA process at https://determined.ai/cla.

After we approve your CLA, we will update the contributors list (private) and comment @cla-bot[bot] check to rerun the check.

@cla-bot cla-bot bot removed the cla-signed label May 9, 2024
@determined-ci
Copy link
Collaborator

Docsite preview being generated for this PR.
You can (eventually) find the generated docsite here.

@determined-ci determined-ci requested a review from a team May 9, 2024 20:33
@determined-ci determined-ci added the documentation Improvements or additions to documentation label May 9, 2024
@determined-ci determined-ci removed the documentation Improvements or additions to documentation label May 9, 2024
Copy link

cla-bot bot commented May 9, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @determined-ci, @djanicekpach, @ShreyaLnuHpe on file. In order for us to review and merge your code, please start the CLA process at https://determined.ai/cla.

After we approve your CLA, we will update the contributors list (private) and comment @cla-bot[bot] check to rerun the check.

@cla-bot cla-bot bot removed the cla-signed label May 9, 2024
@determined-ci determined-ci requested a review from a team May 9, 2024 21:49
@determined-ci
Copy link
Collaborator

Docsite preview being generated for this PR.
You can (eventually) find the generated docsite here.

@determined-ci determined-ci added the documentation Improvements or additions to documentation label May 9, 2024
@carolinaecalderon carolinaecalderon changed the base branch from stoksc/feat/kubernetesjobs to main May 9, 2024 21:50
@carolinaecalderon carolinaecalderon removed the request for review from a team May 9, 2024 21:52
Copy link
Member

@dannysauer dannysauer left a comment

Choose a reason for hiding this comment

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

LGTM. Bummer the orb didn't work out as planned.

@carolinaecalderon carolinaecalderon merged commit 54fb10a into main May 13, 2024
84 of 98 checks passed
@carolinaecalderon carolinaecalderon deleted the carolinac/rm-201 branch May 13, 2024 14:21
carolinaecalderon added a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants