Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

execute test suite only if the setup was successful #424

Merged

Conversation

snorwin
Copy link
Contributor

@snorwin snorwin commented Jun 5, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Since the last changes ( #362) in the error handling of the setup functions, the test suite is also executed if the setup has failed. This can cause the tests to run to timeout because the expected prerequisites are not met. This PR introduces a check to ensure that the test suite is only executed if the setup was successful, otherwise the function returns with exit code 1 and the finish functions are gracefully executed.

Which issue(s) this PR fixes:

Fixes #423

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

The test suite is only executed if the setup was successful.

Additional documentation e.g., Usage docs, etc.:


Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 5, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 5, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @snorwin!

It looks like this is your first PR to kubernetes-sigs/e2e-framework 🎉. 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-sigs/e2e-framework 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 5, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @snorwin. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 5, 2024
@snorwin
Copy link
Contributor Author

snorwin commented Jun 17, 2024

Friendly ping for feedback to @harshanarayana and @ShwethaKumbla .
Thanks in advance 🙏

@harshanarayana
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 Jun 17, 2024
@snorwin
Copy link
Contributor Author

snorwin commented Jun 20, 2024

@harshanarayana thanks for triggering the tests, any chance that this PR is getting reviewed and released soon?

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.

/lgtm

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

@vladimirvivien vladimirvivien 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 simple and it makes sense to be. But I think it will be impactful for existing users who may rely on that existing behavior. Are there cases where continuing with tests after a setup failure is good (I don't know, just asking).

cc @harshanarayana @cpanato

@snorwin
Copy link
Contributor Author

snorwin commented Jun 24, 2024

@vladimirvivien The bug causing tests to run despite setup failures was introduced in v0.4.0 (commit: 70b0316). This caused test pipelines to timeout and generate strange error reports.

Copy link
Contributor

@harshanarayana harshanarayana left a comment

Choose a reason for hiding this comment

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

@vladimirvivien I think it should be ok. Like @snorwin mentioned, this was a side effect of changes done in 70b0316.

Which is really recent change. So, making this change will only revert it back to the original behavior of how things were running with a slight change that the cleanup will happen due to graceful termination unlike the Fatal one before.

pkg/env/env.go Outdated Show resolved Hide resolved
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2024
@snorwin snorwin requested a review from cpanato June 26, 2024 14:42
@cpanato cpanato requested a review from harshanarayana June 28, 2024 13:28
@harshanarayana
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 28, 2024
@cpanato
Copy link
Member

cpanato commented Jun 28, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, snorwin

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 Jun 28, 2024
@k8s-ci-robot k8s-ci-robot merged commit 90eeeb8 into kubernetes-sigs:main Jun 28, 2024
4 checks passed
@snorwin
Copy link
Contributor Author

snorwin commented Jun 28, 2024

@cpanato thanks for considering this fix. Is there a chance to get it released soon?

@cpanato
Copy link
Member

cpanato commented Jun 28, 2024

i will check what we have to be released, but no plans for this week

# for free to join this conversation on GitHub. Already have an account? # 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Test suite is executed even if the setup failed
5 participants