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

Improve unit tests of generic_scheduler #66468

Closed
bsalamat opened this issue Jul 21, 2018 · 1 comment · Fixed by #66471
Closed

Improve unit tests of generic_scheduler #66468

bsalamat opened this issue Jul 21, 2018 · 1 comment · Fixed by #66471
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.

Comments

@bsalamat
Copy link
Member

bsalamat commented Jul 21, 2018

Is this a BUG REPORT or FEATURE REQUEST?: clean-up

Uncomment only one, leave it on its own line:

/kind bug
/kind feature

Unit tests of generic_scheduler.go includes a hack that should be removed. We should add a parameter to the test cases that indicates the expected score and then check if the returned value of the functions matches this expected value.

Below is the hack that we should clean up.

if test.test == "test priority of larger pod with machine with zero-request pod" {
	if hp.Score == expectedPriority {
		t.Errorf("%s: expected non-%d for all priorities, got list %#v", test.test, expectedPriority, list)
	}
}

/sig scheduling

@bsalamat bsalamat added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 21, 2018
@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Jul 21, 2018
@islinwb
Copy link
Contributor

islinwb commented Jul 21, 2018

I'll work on this.
/assign

jessfraz pushed a commit to jessfraz/kubernetes that referenced this issue Jul 24, 2018
Automatic merge from submit-queue (batch tested with PRs 66291, 66471, 66499). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve unit test TestZeroRequest

**What this PR does / why we need it**:

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants