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

add unit tests to scheduler.go #184

Merged
merged 3 commits into from
Nov 22, 2018
Merged

Conversation

weekface
Copy link
Contributor

  • add unit tests to pkg/scheduler/scheduler.go, coverage from 0% to 96.7%
  • add unit tests to pkg/controller_utils.go, coverage from 3.8% to 88%
  • refine Priority method
  • remove some unuse codes

@tennix @xiaojingchen PTAL

@weekface
Copy link
Contributor Author

/run-e2e-tests

tennix
tennix previously approved these changes Nov 21, 2018
Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

_, ok := err.(error)
g.Expect(ok).To(BeTrue())
g.Expect(err.Error()).To(Equal("i am a requeue error"))
}
Copy link
Contributor

@xiaojingchen xiaojingchen Nov 21, 2018

Choose a reason for hiding this comment

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

Suggested change
}
err=fmt.Errorf("i am not a requeue error")
g.Expect(IsRequeueError(err)).To(BeFalse())
}

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

@tennix tennix merged commit 4674cfa into pingcap:master Nov 22, 2018
queenliuxx pushed a commit to queenliuxx/tidb-operator that referenced this pull request Dec 19, 2018
@weekface weekface deleted the scheduler-unit-tests branch June 21, 2019 08:41
fgksgf added a commit to fgksgf/tidb-operator that referenced this pull request Dec 23, 2024
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.

3 participants