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

tekton task to run unit tests #949

Merged
merged 2 commits into from
Jun 10, 2019

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Jun 4, 2019

Changes

This adds a Task to run pipeline's unit tests

Improvements possible:

  • Save the cover file somewhere (in a resource or as a resource 😈)
  • More parameters (to be able to filter tests, or add build tags)

Closes #532

cc @bobcatfish

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.

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2019
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jun 4, 2019
@tekton-robot tekton-robot requested review from dlorenc and imjasonh June 4, 2019 17:35
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2019
@vdemeester vdemeester requested a review from bobcatfish June 4, 2019 17:35
Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

🎉

workingdir: /workspace/src/${inputs.params.package}
command:
- go
args: ["test", "-v", "-cover", "./..."]
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want that race condition flag too?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and/or a flexible set of flags, maybe with a default?

(need that array type! :D #207)

Copy link
Member Author

Choose a reason for hiding this comment

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

good point for race !
yeah we really need #207 😅 as of now, we need a wrapper or some bashism to support flexible set of flags (which reduce a bit readability)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated (in a separate commit)

This adds a Task to run pipeline's unit tests

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the 532-unit-test-task branch from e903fd1 to a88b1b0 Compare June 5, 2019 08:58
It should be possible to use different flags with this task.

The readability is a bit reduce because we are missing Array type of
parameters. Once we have those type of parameter, we can simplify this.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the 532-unit-test-task branch from a88b1b0 to 33bdc7b Compare June 5, 2019 09:05
@vdemeester vdemeester changed the title wip: tekton task to run unit tests tekton task to run unit tests Jun 5, 2019
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2019
@vdemeester
Copy link
Member Author

@bobcatfish removed the wip as I feel it could get in like that 👼
I'll prepare a PR on tektoncd/catalog for some go related re-usable tasks (inspired by this one)

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@dlorenc
Copy link
Contributor

dlorenc commented Jun 10, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2019
@tekton-robot tekton-robot merged commit 480a4c2 into tektoncd:master Jun 10, 2019
@vdemeester vdemeester deleted the 532-unit-test-task branch June 10, 2019 17:04
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.

Create Task for Tekton Pipeline unit tests
5 participants