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

No need to assert an error when the error is not nil #111377

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

chendave
Copy link
Member

@chendave chendave commented Jul 25, 2022

What type of PR is this?

- Improve test coverage of scheduler options for v1beta3 API, Scheduler is now at v1beta3 while some of the testcases are only focus on v1beta2.

  • No need to assert an error when the error is not nil.

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

/kind cleanup

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 25, 2022
@k8s-ci-robot
Copy link
Contributor

@chendave: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 25, 2022
@chendave
Copy link
Member Author

/sig scheduling

@chendave
Copy link
Member Author

I am going to refactor the whole test file in another pr.

@chendave
Copy link
Member Author

/retest

@@ -1129,6 +1153,15 @@ profiles:
expectedError: `unknown field "foo"`,
checkErrFn: runtime.IsStrictDecodingError,
},
{
Copy link
Member

Choose a reason for hiding this comment

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

Actually, we're going to mark v1beta2 as deprecated after #110534, so I was doubt about whether we need this any more. -_-

Copy link
Member Author

Choose a reason for hiding this comment

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

basically, this pr add some testcase for v1beta3, since it was on v1beta2 only, I think this should be okay.

@kerthcet
Copy link
Member

I am going to refactor the whole test file in another pr.

Friendly ping, the refactor may be conflict with #110534, considering we're approaching the deadline of code freeze on 3st August, how about merge this one firstly, will this breaking your developing plan?

@chendave
Copy link
Member Author

since this has some conflict with #110534, I will come back to check this again after that one got merged.

will revert to leave the fix on the nit only.

Signed-off-by: Dave Chen <dave.chen@arm.com>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 25, 2022
@chendave
Copy link
Member Author

/retitle No need to assert an error when the error is not nil

@k8s-ci-robot k8s-ci-robot changed the title scheduler: Improve the testcases for scheduler options No need to assert an error when the error is not nil Jul 25, 2022
@chendave
Copy link
Member Author

@kerthcet no conflict anymore. :)

@kerthcet
Copy link
Member

/retest
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 25, 2022
@chendave
Copy link
Member Author

/assign @damemi
for approval, this is really an easy one. :)

@@ -1163,7 +1163,7 @@ profiles:
}
return
}
assert.NoError(t, err)
t.Errorf("unexpected error to create a config: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a need to log anything here or are the checks above thorough enough?

for example, if the error here is expected, this message is misleading

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't happen here, but if it does, we should emit the error.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah sorry, I misread the code, you are correct

@damemi
Copy link
Contributor

damemi commented Jul 25, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chendave, damemi

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2022
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 17efdc6 into kubernetes:master Jul 25, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Jul 25, 2022
@chendave chendave deleted the v1beta3 branch July 26, 2022 02:19
@kerthcet
Copy link
Member

Kindly ping @chendave , #110534 is merged, feel free to check this again. FYI test freeze will end int 10th August. :)

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants