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

TestBuilder(): be able to expect errors #244

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

nalind
Copy link
Member

@nalind nalind commented Feb 3, 2023

Update some test cases so that we can fail a test if we expect to get an error, but don't see one.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2023
@@ -775,9 +776,6 @@ func TestBuilder(t *testing.T) {
Image: "centos:7",
Shell: []string{"/bin/bash", "-xc"},
},
ErrFn: func(err error) bool {
return err != nil && strings.Contains(err.Error(), "multiple FROM statements are not supported")
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this is getting removed? More tea for me?

Copy link
Member Author

Choose a reason for hiding this comment

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

The Dockerfile the test uses doesn't have multiple FROM statements in it, so the function was never called. Under the new paradigm, having a function that decides whether or not to ignore an error, but not having an error to pass to it, would cause the test to fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, thought this test had multiple FROM calls. SGTM.

@TomSweeneyRedHat
Copy link
Contributor

LGTM

@nalind nalind force-pushed the expect-errors branch 4 times, most recently from 5096a53 to b39c888 Compare February 9, 2023 14:51
@rhatdan
Copy link
Contributor

rhatdan commented Feb 9, 2023

/hold
/lgtm

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 9, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2023
Update some test cases so that we can fail a test if we expect to get an
error, but don't see one.

Remove the expectation of a "no multiple FROMs allowed" error from the
Dockerfile.shell test case, which only used one FROM in its Dockerfile.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2023

@nalind: all tests passed!

Full PR test history. Your PR dashboard.

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.

@rhatdan
Copy link
Contributor

rhatdan commented Feb 9, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nalind, rhatdan

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

@rhatdan
Copy link
Contributor

rhatdan commented Feb 10, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2023
@openshift-merge-robot openshift-merge-robot merged commit 72a3b4b into openshift:master Feb 10, 2023
@nalind nalind deleted the expect-errors branch February 10, 2023 14:10
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants