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

fix wrong assertion on tests #130359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

my-git9
Copy link
Member

@my-git9 my-git9 commented Feb 22, 2025

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #130346

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. 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 Feb 22, 2025
@k8s-ci-robot
Copy link
Contributor

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-sigs/prow 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. labels Feb 22, 2025
@k8s-ci-robot k8s-ci-robot added area/apiserver area/code-generation area/kubelet area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 22, 2025
@aojea
Copy link
Member

aojea commented Feb 22, 2025

almost there, only three issues left

@aojea
Copy link
Member

aojea commented Feb 22, 2025

@my-git9 there are still missing files

RROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:202:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:258:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:290:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.DeadlineExceeded)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:338:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:395:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^

please enable the linter in our golangci config so we run it in presubmits

diff --git a/hack/golangci.yaml b/hack/golangci.yaml
index ff24e6d6d18..ed5382dc0f1 100644
--- a/hack/golangci.yaml
+++ b/hack/golangci.yaml
@@ -277,5 +277,4 @@ linters-settings: # please keep this alphabetized
     enable-all: true
     disable:  # TODO: remove each disabled rule and fix it
       - float-compare
-      - go-require
       - require-error

@adrianmoisey
Copy link
Member

Could you tidy the commits up?
The add go required check commit includes changes that are not related to enabling that check, making for a confusing history

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: my-git9
Once this PR has been reviewed and has the lgtm label, please assign smarterclayton for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@my-git9 my-git9 requested a review from aojea February 23, 2025 08:55
@my-git9
Copy link
Member Author

my-git9 commented Feb 23, 2025

Could you tidy the commits up? The add go required check commit includes changes that are not related to enabling that check, making for a confusing history

updated, thx

@my-git9
Copy link
Member Author

my-git9 commented Feb 23, 2025

@my-git9 there are still missing files

RROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:202:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:258:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:290:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.DeadlineExceeded)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:338:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^
ERROR: staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go:395:3: go-require: require must only be used in the goroutine running the test function (testifylint)
ERROR:          require.ErrorIs(t, stopReason, context.Canceled)
ERROR:          ^

please enable the linter in our golangci config so we run it in presubmits

diff --git a/hack/golangci.yaml b/hack/golangci.yaml
index ff24e6d6d18..ed5382dc0f1 100644
--- a/hack/golangci.yaml
+++ b/hack/golangci.yaml
@@ -277,5 +277,4 @@ linters-settings: # please keep this alphabetized
     enable-all: true
     disable:  # TODO: remove each disabled rule and fix it
       - float-compare
-      - go-require
       - require-error

updated, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/code-generation area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. 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/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Wrong assertion on tests
4 participants