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 kubetest errors when executing local provider #107386

Conversation

ZeusPerez
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

I'm trying to run the end-2-end tests locally using kind for running the Kubernetes cluster, and when I execute kubetest --provider local --deployment local --test --check-version-skew false I get 2 errors:

The first one:

2022/01/06 13:30:10 main.go:284: Running kubetest version: 
2022/01/06 13:30:10 process.go:153: Running: $HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson
$HOME/kubernetes/kubernetes/cluster/../cluster/../hack/lib/util.sh: line 226: kube::log::error: command not found
2022/01/06 13:30:11 process.go:155: Step '$HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson' finished in 1.136083829s
2022/01/06 13:30:11 kubernetes.go:35: kubectl get nodes failed: error during $HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson: exit status 1
2022/01/06 13:30:11 main.go:331: Something went wrong: encountered 1 errors: [error during $HOMEts/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson: exit status 1]

This is because it doesn't find the kube::log::error. I've solved it adding source "${KUBE_ROOT}/hack/lib/logging.sh" to cluster/kubectl.sh

The second one is:

2022/01/06 13:33:59 main.go:284: Running kubetest version: 
2022/01/06 13:33:59 process.go:153: Running: $HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson
!!! [0106 13:33:59] Failed to find binary kubectl for platform darwin/amd64
2022/01/06 13:33:59 process.go:155: Step '$HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson' finished in 666.903805ms
2022/01/06 13:33:59 kubernetes.go:35: kubectl get nodes failed: error during $HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson: exit status 1
2022/01/06 13:33:59 main.go:331: Something went wrong: encountered 1 errors: [error during $HOME/kubernetes/kubernetes/cluster/kubectl.sh get nodes -ojson: exit status 1]

In this case, the script is looking for the kubectl binary in:

      "${KUBE_ROOT}/_output/local/go/bin/${lookfor}"
      "${KUBE_ROOT}/_output/dockerized/go/bin/${lookfor}"

Not sure if I miss any setup step for the test, but I have that binary in my $PATH and I would expect that it would be a valid location too.

To solve this, I added this for finding the executable in the $PATH too:

  if which ${lookfor} >/dev/null; then
    local -r local_bin="$(which ${lookfor})"
    locations+=( "${local_bin}"  );
  fi

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

This is my first time contributing to Kubernetes and I'm not completely sure that my premises are correct.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 6, 2022
@linux-foundation-easycla
Copy link

CLA Not Signed

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 6, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @ZeusPerez!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 6, 2022
@k8s-ci-robot
Copy link
Contributor

@ZeusPerez: 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
Copy link
Contributor

Hi @ZeusPerez. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jan 6, 2022
@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from 126c97c to cf72d13 Compare January 6, 2022 13:07
@linux-foundation-easycla
Copy link

CLA Not Signed

@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from cf72d13 to ae7a59e Compare January 6, 2022 13:19
@linux-foundation-easycla
Copy link

CLA Not Signed

@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from ae7a59e to ee29d9b Compare January 6, 2022 17:45
@linux-foundation-easycla
Copy link

CLA Not Signed

@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from ee29d9b to 4d7c270 Compare January 6, 2022 17:48
@linux-foundation-easycla
Copy link

CLA Not Signed

@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from 4d7c270 to 1f9476a Compare January 6, 2022 17:58
@linux-foundation-easycla
Copy link

CLA Not Signed

  • ✅ ZeusPerez (1f9476a826947dc27367d516d4dc7a62b3062cce)

@ZeusPerez ZeusPerez force-pushed the fix-kubetest-errors-when-executing-local-provider branch from 1f9476a to 5d52b4e Compare January 6, 2022 18:03
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 6, 2022
@dims
Copy link
Member

dims commented Jan 14, 2022

/ok-to-test
/sig testing
/assign

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 14, 2022
@ZeusPerez
Copy link
Contributor Author

/test pull-kubernetes-verify

@ZeusPerez
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind

@ZeusPerez
Copy link
Contributor Author

/test pull-kubernetes-integration

@ZeusPerez
Copy link
Contributor Author

/test pull-kubernetes-conformance-kind-ga-only-parallel

@dims
Copy link
Member

dims commented Jan 31, 2022

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, ZeusPerez

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 Jan 31, 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

1 similar comment
@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 6dd234d into kubernetes:master Feb 1, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Feb 1, 2022
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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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

4 participants