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

WIP: add helm test step to gh-actions #895

Closed

Conversation

knelasevero
Copy link
Contributor

Also, remove local helm testing in favor of ct in PRs.

Example successful run can be checked here (from my fork to my fork): https://github.com/knelasevero/descheduler/pull/2/checks

Example fail: https://github.com/knelasevero/descheduler/runs/7564334471?check_suite_focus=true

We already get events, describe, and logs of the deployed chart pod in the CI directly.

I am already removing the scripts and references to previous helm testing approach.

So /hold this one until I normalize and merge kubernetes/test-infra#26630

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @knelasevero. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 29, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign seanmalloy for approval by writing /assign @seanmalloy in a comment. For more information see:The Kubernetes 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

@k8s-ci-robot k8s-ci-robot requested review from a7i and aveshagarwal July 29, 2022 13:36
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 29, 2022
@knelasevero
Copy link
Contributor Author

@cpanato you mentioned some improvements that could be done to this. If you prefer we can review in this PR, or I can merge this and wait for a follow up PR from you. Your call ❤️

@ingvagabund
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added 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. labels Jul 29, 2022
Copy link
Contributor

@ingvagabund ingvagabund left a comment

Choose a reason for hiding this comment

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

This looks really great. I like how easy it is to read the workflow. Also https://github.com/kubernetes-sigs/descheduler/runs/7579750658?check_suite_focus=true looks great with all the events, pod spec and container logs.

Helm / lint-and-test (pull_request) test is currently not required. We need to make sure it is.

.github/workflows/helm.yaml Outdated Show resolved Hide resolved
docs/contributor-guide.md Show resolved Hide resolved
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

@knelasevero
Copy link
Contributor Author

@knelasevero knelasevero force-pushed the helm-test-install branch 8 times, most recently from a08c28d to 183c857 Compare August 1, 2022 13:15

# Force linting/test in debug runs with a change (this action only runs on chart and helm.yaml workflow diffs anyways)
- name: Change Kind to deployment
run: "sed -i \"s|kind: [^ ]*|kind: Deployment|g\" charts/descheduler/values.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems odd to do, when we can have a specific values file that can do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was only to force ct lint and ct install to show changes, it is unrelated to this value change itself. I want to remove this when the work is finished.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I was planning on leaving this, but now I see it is too ugly/confusing 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will wait for lgtms and approves, but /hold so I remember to remove this line when reviews are done

.github/workflows/helm.yaml Outdated Show resolved Hide resolved
    and remove local helm testing in favor of ct in PRs
@k8s-ci-robot
Copy link
Contributor

@knelasevero: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-descheduler-helm-test afe1186 link true /test pull-descheduler-helm-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@@ -0,0 +1,3 @@
#!/bin/bash

docker run -it --rm --network host --workdir=/data --volume ~/.kube/config:/root/.kube/config:ro --volume $(pwd):/data quay.io/helmpack/chart-testing:v3.7.0 /bin/bash -c "git config --global --add safe.directory /data; ct install --config=.github/ci/ct.yaml --helm-extra-set-args=\"--set=kind=Deployment --set=podSecurityPolicy.create=false\""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason when calling from make the helm-extra-set-args from .github/ci/ct.yaml are being ignored... had to set them manually here as arguments of ct.

@knelasevero
Copy link
Contributor Author

/hold after reviews are done I will remove #895 (comment)

and also need to wait for kubernetes/test-infra#26630

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 1, 2022
@ingvagabund
Copy link
Contributor

ingvagabund commented Aug 2, 2022

and also need to wait for kubernetes/test-infra#26630

I'd prefer first to introduce a new test, merge this PR, merge kubernetes/test-infra#26630 and then change the make test-helm to run locally.

In overall, this is quite awesome improvement :)

@knelasevero
Copy link
Contributor Author

knelasevero commented Aug 2, 2022

and also need to wait for kubernetes/test-infra#26630

I'd prefer first to introduce a new test, merge this PR, merge kubernetes/test-infra#26630 and then change the make test-helm to run locally.

New test? 🤔 You mean this PR itself as the replacement, or something else?

Merge this PR

If we merge this PR first, all new PRs will fail because of inexistent scripts being called on k/test-infra steps.

make test-helm

I've introduced make ct-helm in this PR, and it runs locally against kind

In overall, this is quite awesome improvement :)

🙌🙌

@ingvagabund
Copy link
Contributor

I would like to see the changes in the following order:

  1. updating this PR so only a new Helm / lint-and-test (pull_request) test is introduced while still keeping pull-descheduler-helm-test and make test-helm unchanged (merged through WIP: add helm test step to gh-actions #895)
  2. making sure the new Helm / lint-and-test (pull_request) test is required and a PR does not merge without the new test going green (this is paramount and needs to be verified)
  3. removing pull-descheduler-helm-test test (descheduler: remove helm tests from prow kubernetes/test-infra#26630 gets merged)
  4. updating the make test-helm to run the new Helm / lint-and-test (pull_request) test locally (new PR)

@knelasevero
Copy link
Contributor Author

I would like to see the changes in the following order:

  1. updating this PR so only a new Helm / lint-and-test (pull_request) test is introduced while still keeping pull-descheduler-helm-test and make test-helm unchanged (merged through add helm test step to gh-actions #895)
  2. making sure the new Helm / lint-and-test (pull_request) test is required and a PR does not merge without the new test going green (this is paramount and needs to be verified)
  3. removing pull-descheduler-helm-test test (descheduler: remove helm tests from prow kubernetes/test-infra#26630 gets merged)
  4. updating the make test-helm to run the new Helm / lint-and-test (pull_request) test locally (new PR)

You are right, that makes sense. I will convert this PR in a draft/wip to keep it as reference, and open new PRs step by step then. Then we can actually just test if prow ignores or considers gh-actions workflows before merging right after the first merge :)

@knelasevero knelasevero marked this pull request as draft August 3, 2022 19:41
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 3, 2022
@knelasevero knelasevero changed the title add helm test step to gh-actions WIP: add helm test step to gh-actions Aug 3, 2022
knelasevero added a commit to knelasevero/descheduler that referenced this pull request Aug 8, 2022
@k8s-ci-robot
Copy link
Contributor

@knelasevero: PR needs rebase.

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-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants