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

Skip some tests if KO_DOCKER_REPO is missing… #710

Merged
merged 1 commit into from
Apr 5, 2019

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Apr 2, 2019

Changes

… instead of "hard" failing, we could just skip it as it doesn't meet
the requirements. Impacted tests :

  • TestHelmDeployPipelineRun
  • TestKanikoTaskRun

To skip those tests instead of failing, you need to provide the following arguments to go test command :
-ldflags '-X github.com/tektoncd/pipeline/test.missingKoFatal=false'

Signed-off-by: Vincent Demeester vdemeest@redhat.com

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Apr 2, 2019
@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 2, 2019
@vdemeester vdemeester force-pushed the tests-skip-if branch 2 times, most recently from 978c144 to 7fa00ae Compare April 2, 2019 11:06
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@imjasonh
Copy link
Member

imjasonh commented Apr 2, 2019

I think I'd rather have tests fail loudly than silently pass if a prerequisite isn't provided. Ignoring failing tests like this can lead to surprising bugs that slip by tests.

If there's some reason why it should be possible to run all e2e tests without setting KO_DOCKER_REPO you could have a build tag to exclude/include the ko-requiring tests, but that's probably overkill.

In what scenarios should KO_DOCKER_REPO be unset during e2e tests?

@vdemeester
Copy link
Member Author

Discussed with @imjasonh on slack, let's go for a test flag to skip them instead of failing (and default to failing, so… no behaviour change on the CI)

@vdemeester
Copy link
Member Author

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 2, 2019
Copy link

@arilivigni arilivigni left a comment

Choose a reason for hiding this comment

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

lgtm

@arilivigni
Copy link

/lgtm

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arilivigni, vdemeester

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

@tekton-robot
Copy link
Collaborator

@arilivigni: changing LGTM is restricted to assignees, and only tektoncd/pipeline repo collaborators may be assigned issues.

In response to this:

/lgtm

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.

@nader-ziada
Copy link
Member

These tests are already skipped if KO_DOCKER_REPO is not set, why add another flag to skip them?

@vdemeester
Copy link
Member Author

@pivotal-nader-ziada the idea is to make it Fatal by default (and make it really explicit if we want to skip them instead of fail)

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 3, 2019
… instead of "hard" failing, we could just skip it as it doesn't meet
the requirements. Impacted tests :

- TestHelmDeployPipelineRun
- TestKanikoTaskRun

To skip those tests instead of failing, you need to provide the
following arguments to go test command :
`-ldflags '-X github.com/tektoncd/pipeline/test.missingKoFatal=false'`

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester
Copy link
Member Author

/hold cancel
cc @bobcatfish @imjasonh

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 5, 2019
@abayer
Copy link
Contributor

abayer commented Apr 5, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2019
@tekton-robot tekton-robot merged commit 28cf0ea into tektoncd:master Apr 5, 2019
@vdemeester vdemeester deleted the tests-skip-if branch April 5, 2019 12:03
return "", fmt.Errorf("KO_DOCKER_REPO env variable is required")
}
return fmt.Sprintf("%s/kanikotasktest", dockerRepo), nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

another beautiful file 💃

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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm 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.

None yet

8 participants