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

Integration tests for Tekton #528

Merged
merged 16 commits into from
Dec 6, 2019

Conversation

mgencur
Copy link
Contributor

@mgencur mgencur commented Nov 29, 2019

Fixes #471

Proposed Changes

  • install Tekton as part of the CI run
  • run integration tests using Tekton Pipeline and PipelineRun which pulls source for an application from github, builds it, pushes the resulting image to GCR registry and then runs kn task to create a Knative Service
  • there's a separate tekton-tests.sh which runs the tests but doesn't run as part of normal CI, we should create a nightly job that will use this script

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 29, 2019
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 29, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@mgencur: 0 warnings.

In response to this:

Fixes #

Proposed Changes

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.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 29, 2019
@mattmoor mattmoor removed their request for review December 1, 2019 15:28
* also put back the e2e-tests into its original format where it doesn't
run the tekton tests
@mgencur mgencur changed the title [WIP] Integration tests for Tekton Integration tests for Tekton Dec 2, 2019
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2019
@mgencur
Copy link
Contributor Author

mgencur commented Dec 2, 2019

The "build-tests" check is failing but I'm not sure why. They error message is ERROR: /home/prow/go/src/knative.dev/client is out of date. Please run ./hack/build.sh -c and commit. but I've already rebased and run ./hack/build.sh -c and committed. I'd appreciate some help on this bit.
The last commit on this PR returns the e2e-tests.sh script into the right format which means the tests for Tekton are not run in this CI checks. Results for Tekton can be seen in the previous run (before the last commit was added): https://prow.knative.dev/view/gcs/knative-prow/pr-logs/pull/knative_client/528/pull-knative-client-integration-tests/1201417741060280321

@mgencur
Copy link
Contributor Author

mgencur commented Dec 2, 2019

The only change I did not commit after running ./hack/build.sh was go 1.13 in go.mod, but I'm not sure it should cause this trouble.

Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

Thanks a lot @mgencur for putting this together, I've added few comments rest lgtm. We should reference the used tasks from catalog.

test/e2e/tekton_test.go Outdated Show resolved Hide resolved
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/buildah-task.yaml"}, runOpts{})
assert.NilError(t, err)

_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-task.yaml"}, runOpts{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as for buildah task, lets grab them from catalog

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-task.yaml"}, runOpts{})
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/kn/kn.yaml"}, runOpts{})

test/test_images/helloworld/Dockerfile Outdated Show resolved Hide resolved
test/resources/tekton/buildah-task.yaml Outdated Show resolved Hide resolved
test/resources/tekton/kn-pipeline.yaml Show resolved Hide resolved
@navidshaikh
Copy link
Collaborator

The "build-tests" check is failing but I'm not sure why.

I think it's because of the golang version used, if you retry(./hack/build.sh) with go 1.12.x you'd see the difference.

@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 2, 2019
test/test_images/helloworld/Dockerfile Outdated Show resolved Hide resolved
test/resources/tekton/kn-pipeline.yaml Show resolved Hide resolved
test/e2e/tekton_test.go Outdated Show resolved Hide resolved
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/buildah-task.yaml"}, runOpts{})
assert.NilError(t, err)

_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-task.yaml"}, runOpts{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-task.yaml"}, runOpts{})
_, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/kn/kn.yaml"}, runOpts{})

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 2, 2019
test/tekton-tests.sh Outdated Show resolved Hide resolved
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: tekton.dev/v1alpha1
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the version be parametrized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the tests fail with a newer version of Tekton then these files will need to be updated at that point and committed. The tests are there for testing regressions with future versions of Tekton / kn. They're not there to test compatibility of multiple versions of Tekton with different apiVersion versions; so IMO adding this as a parameter would not bring any benefits.

@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 4, 2019
@mgencur
Copy link
Contributor Author

mgencur commented Dec 4, 2019

This run shows latest changes: https://prow.knative.dev/view/gcs/knative-prow/pr-logs/pull/knative_client/528/pull-knative-client-integration-tests/1202199261303803905 , tests passed. I'll remove the last commit to get it ready for integration.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 4, 2019
@mgencur
Copy link
Contributor Author

mgencur commented Dec 4, 2019

Hey! Thanks for reviews. All comments addressed. Please review the latest changes.

Copy link
Contributor

@adrcunha adrcunha left a comment

Choose a reason for hiding this comment

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

/lgtm

test/e2e/tekton_test.go Outdated Show resolved Hide resolved
test/tekton-tests.sh Outdated Show resolved Hide resolved
test/tekton-tests.sh Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2019
@@ -25,15 +25,7 @@
# the cluster.

source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh

@@ -29,29 +29,10 @@
# of this specified version will be installed in the Kubernetes cluster, and
# all the tests will run against Knative serving of this specific version.
source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh

test/e2e-common.sh Show resolved Hide resolved
Copy link
Contributor

@adrcunha adrcunha left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2019
Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks @mgencur !

Logged knative/test-infra#1575 to configure running these e2e as nightly and pre-release Job.

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgencur, navidshaikh

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2019
@knative-prow-robot knative-prow-robot merged commit 60567a9 into knative:master Dec 6, 2019
coryrc pushed a commit to coryrc/client that referenced this pull request May 14, 2020
Addresses knative#527.

So it's easy to check them when running E2E tests locally.

`e2e-tests.sh` now displays where the artifacts were written once it finishes. For local runs, this is a new temporary directory and will contain both the JUnit XML file and the full go test log.
creydr pushed a commit to creydr/knative-client that referenced this pull request Nov 25, 2024
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 Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create integration tests for kn task in tektoncd catalog
7 participants