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

cmd/critest: fix empty ginkgo flag's value issue #930

Merged

Conversation

fuweid
Copy link
Contributor

@fuweid fuweid commented May 11, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

In commit 53ad8bb 1, the ginkgo uses
flags.StringVar for some flags, for instance, the --skip or --focus.

But in the following release of ginkgo(>=v1.15.0 2), the ginkgo starts to
use string slice instead of the StringVar, which means we can't get the
user's input by the flags.Value.String() 3. The String() always returns
empty value.

Based on that, we should use ginkgo API to generate flags instead of
manually handler in cri-test.

Which issue(s) this PR fixes:

Fixes: #925

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 11, 2022
In commit 53ad8bb[1], the ginkgo uses
flags.StringVar for some flags, for instance, the --skip or --focus.

But in the following release of ginkgo(>=v1.15.0[2]), the ginkgo starts to
use string slice instead of the StringVar, which means we can't get the
user's input by the flags.Value.String()[3]. The String() always returns
empty value.

Based on that, we should use ginkgo API to generate flags instead of
manually handler in cri-test.

Reference:

[1]: https://github.com/kubernetes-sigs/cri-tools/blob/53ad8bb7f97e1b1d1c0c0634e43a3c2b8b07b718/vendor/github.com/onsi/ginkgo/config/config.go L79
[2]: https://github.com/onsi/ginkgo/blob/v1.15.0/config/config.go L84
[3]: https://github.com/onsi/ginkgo/blob/v1.15.0/config/config.go L68-L71

Signed-off-by: Wei Fu <fuweid89@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 11, 2022
@fuweid
Copy link
Contributor Author

fuweid commented May 11, 2022

My local test result is like

➜  cri-tools git:(support-string-slice-var) sudo build/bin/critest -parallel $(nproc) -ginkgo.skip="Image"            
critest version: 1.24.0-7-g651ff15e
Running Suite: CRI validation - /tmp/cri-test2158160727
=======================================================
Random Seed: 1652281139

Will run 69 of 76 specs
Running in parallel across 8 processes

Both the skip and parallel mode are working.

@fuweid
Copy link
Contributor Author

fuweid commented May 11, 2022

/retest

@k8s-ci-robot
Copy link
Contributor

@fuweid: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@fuweid
Copy link
Contributor Author

fuweid commented May 12, 2022

Ping @feiskyer @saschagrunert

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Thank you!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fuweid, saschagrunert

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 May 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 99cc69f into kubernetes-sigs:master May 12, 2022
@fuweid fuweid deleted the support-string-slice-var branch May 12, 2022 08:10
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.

Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
(cherry picked from commit 7300296)

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.

Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
psschwei added a commit to psschwei/containerd that referenced this pull request May 12, 2022
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
(cherry picked from commit 7300296)

As discussed in containerd#6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
kubernetes-sigs/cri-tools#930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.

Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ginkgo version aligning
3 participants