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

Add E2E test to create pipeline run #2565

Merged
merged 1 commit into from
Nov 7, 2022
Merged

Conversation

marniks7
Copy link
Contributor

@marniks7 marniks7 commented Nov 3, 2022

Changes

Add e2e test to create pipeline run that can be executed from any environment.
This is preparation for tests for workspaces and for yaml editor

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (new features, significant UI changes, API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 3, 2022
@tekton-robot
Copy link
Contributor

Hi @marniks7. 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 3, 2022
@marniks7
Copy link
Contributor Author

marniks7 commented Nov 3, 2022

/kind misc

@tekton-robot tekton-robot added kind/misc Categorizes issue or PR as a miscellaneuous one. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 3, 2022
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 3, 2022
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 3, 2022
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2022
Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @marniks7. Overall it looks good, we just need to avoid doing anything platform specific where possible. Let me know if you have any questions.

packages/e2e/Dockerfile Outdated Show resolved Hide resolved
packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js Outdated Show resolved Hide resolved
packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js Outdated Show resolved Hide resolved
test/e2e-tests.sh Outdated Show resolved Hide resolved
test/e2e-tests.sh Outdated Show resolved Hide resolved
test/e2e-tests.sh Outdated Show resolved Hide resolved
cy.contains('button', 'Create').click();
cy.contains('simple-pipeline').first().click();

cy.get('header[class="tkn--pipeline-run-header"]', { timeout: 10000 })
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious where the timeout values here came from, was it from experimentation?
We'll need to keep an eye on these to ensure we don't end up with a flaky test.

Copy link
Contributor Author

@marniks7 marniks7 Nov 4, 2022

Choose a reason for hiding this comment

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

It was experimentation over many runs (but I have done that for pipeline with workspaces)

reworked

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I should have been clearer, my comment was just pointing out that we'll need to be aware of this and account for CI potentially being slower than a local cluster, not requesting a change in strategy.

I would prefer to increase the timeout for the status and remove the retries. Especially in CI where we create a new cluster and registry it's likely to take longer to run the first time due to pulling the image used in the pipeline. Subsequent attempts will most likely be faster as the image has already been pulled which is why the retries succeed. Using retries to accommodate this also has the side effect of creating multiple runs which we don't really need.

We should also consider cleanup after a successful run and delete it but that can be done later.

Copy link
Member

Choose a reason for hiding this comment

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

Please also squash your commits when done so this is ready to merge.

Copy link
Contributor Author

@marniks7 marniks7 Nov 5, 2022

Choose a reason for hiding this comment

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

Ok,

  • timeout increased to 15s for status wait
    • on my pc and CI it takes 6s for everything (but image is pulled before that because image: busybox is used in static resources and those tests)
      image
  • retries removed

@AlanGreene, note, I have changed permission for ~/.kube/config file to 644 otherwise permission denied on CI. I don't like that much for local runs, because it change permissions for common user kubeconfig file
Other option:

  • copy ~/.kube/config file to ~/.kube/tekton, change permissions for ~/.kube/tekton, add trap before docker run and remove file ~/.kube/tekton in the trap

@AlanGreene
Copy link
Member

/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 Nov 4, 2022
Add e2e test to create pipeline run that can be executed from any environment
@marniks7
Copy link
Contributor Author

marniks7 commented Nov 5, 2022

/test tekton-dashboard-unit-tests

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlanGreene

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 Nov 7, 2022
@AlanGreene
Copy link
Member

Thanks @marniks7
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2022
@tekton-robot tekton-robot merged commit 8b7ccf2 into tektoncd:main Nov 7, 2022
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. kind/misc Categorizes issue or PR as a miscellaneuous one. 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/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.

3 participants