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

Improve CLI e2e go tests #505

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Improve CLI e2e go tests #505

merged 1 commit into from
Mar 10, 2020

Conversation

praveen4g0
Copy link

Changes

I have Added E2E cli tests for pipelines alone.

Submitter Checklist

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

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Regenerate the manpages and docs with make docs and make man if needed.
  • Run the code checkers with make check
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

release-note

@tekton-robot
Copy link
Contributor

Hi @praveen4g0. Thanks for your PR.

I'm waiting for a tektoncd 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.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 7, 2019
@tekton-robot
Copy link
Contributor

@praveen4g0: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@piyush-garg
Copy link
Contributor

/ok-to-test

@tekton-robot tekton-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 Dec 7, 2019
@praveen4g0
Copy link
Author

/rerun pull-tekton-cli-unit-tests

@vdemeester
Copy link
Member

/test pull-tekton-cli-unit-tests

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

Let's get this in and iterate over it

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2019
@tekton-robot
Copy link
Contributor

[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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 20, 2019
@vdemeester
Copy link
Member

/retest

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2019
@chmouel
Copy link
Member

chmouel commented Dec 20, 2019

IMHO we need to figure out about the flakyness of go-netflix before merging this, see #499 for details.

Feel free to remove this /hold if you tink otherwise

/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 Dec 20, 2019
@praveen4g0
Copy link
Author

/test pull-tekton-cli-build-tests

@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
third_party/VENDOR-LICENSE/github.com/hashicorp/golang-lru/2q.go Do not exist 91.7%
third_party/VENDOR-LICENSE/github.com/hashicorp/golang-lru/arc.go Do not exist 94.4%
third_party/VENDOR-LICENSE/github.com/hashicorp/golang-lru/lru.go Do not exist 91.1%
third_party/VENDOR-LICENSE/github.com/hashicorp/golang-lru/simplelru/lru.go Do not exist 88.3%

@praveen4g0
Copy link
Author

/test pull-tekton-cli-unit-tests

1 similar comment
@praveen4g0
Copy link
Author

/test pull-tekton-cli-unit-tests

@praveen4g0
Copy link
Author

/test pull-tekton-cli-integration-tests

@praveen4g0
Copy link
Author

@vdemeester do you see still see any blocker to merge this pr??

@vdemeester
Copy link
Member

/hold cancel

@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 Feb 25, 2020
@vdemeester vdemeester added this to the 0.9.0 🐺 milestone Feb 27, 2020
Copy link
Member

@danielhelfand danielhelfand left a comment

Choose a reason for hiding this comment

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

Overall, I am struggling with the structure of these e2e tests in this pr. My apologies as this is the first time I am reviewing this and this pr is large in general, but I wanted to clarify some things before this moves forward:

  1. Do we know how much of the old suite of tests is covered in this conversion/ how similar the tests are? I'll start doing a more thorough review of this as well.
  2. I get that this is a first attempt to get all the e2e tests over to go, but the organization of the tests themselves is hard to follow. pipeline_e2e_test.go should be broken up into different files, but that's perhaps something we need to iterate on.

func GetTaskRun(c *Clients, name string) *v1alpha1.TaskRun {

taskRun, err := c.TaskRunClient.Get(name, metav1.GetOptions{})
// require.Nil(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

Can all the commented out code be removed?

// 	require.Nil(t, err)

test/environment/environment.go Outdated Show resolved Hide resolved
@vdemeester
Copy link
Member

1. Do we know how much of the old suite of tests is covered in this conversion/ how similar the tests are? I'll start doing a more thorough review of this as well.

I'm temporarly adding back the old ones to make sure we don't loose coverage

2. I get that this is a first attempt to get all the e2e tests over to go, but the organization of the tests themselves is hard to follow. `pipeline_e2e_test.go` should be broken up into different files, but that's perhaps something we need to iterate on.

Yep, I plan to follow-up to clean a little bit of stuff and split those tests and organize them a little bit better 😉

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Mar 3, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Mar 3, 2020
})

})
// Bug to fix
Copy link
Member

Choose a reason for hiding this comment

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

Can this comment be removed, or is there something to denote here?


// Assert compares the Result against the Expected struct, and fails the test if
// any of the expectations are not met.
//
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed

@danielhelfand
Copy link
Member

I am fine with moving forward with this after the nit comments are dealt with. If we could have just one other person review, I think this should be good to go.

go.mod Outdated
go.uber.org/multierr v1.1.0
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
Copy link
Contributor

Choose a reason for hiding this comment

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

https://godoc.org/golang.org/x/xerrors

These functions were incorporated into the standard library's errors package in Go 1.13

Copy link
Member

Choose a reason for hiding this comment

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

@ppitonak indeed (with a slight signature change). Anyway, we can get rid of those in a follow-up (also, depending on our dependency it might become a transitive dep anway)

updated e2e.sh

Added tkn environment varaiable

Updated pipelines E2E tests

Update go.sum

Deleted third-party

updated go.mod

update pipeline, interactive cli Tests

Fix: update client.go with lates pipeline bump (v0.10.1)

fixed: golint error

Fix: Pipeline start assertion

Update README.md

Fix: build failures
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>

Add old e2e tests back while we port them to go

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

Small fixes to commented code

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

Update test/resources/output-pipelinerun.yaml

Drop the flag to InitializeLogger
Copy link
Member

@danielhelfand danielhelfand left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for all your work on this @praveen4g0!

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2020
@tekton-robot tekton-robot merged commit 39ad796 into tektoncd:master Mar 10, 2020
@danielhelfand danielhelfand mentioned this pull request Mar 26, 2020
4 tasks
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 lgtm 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants