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

Test tasks that only has been modified or added #385

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Jun 23, 2020

Changes

We are nnow only doing integration tests on the tasks that has been modified or added. This will improve the speed of each PR iteration not testing everything while the PR modify only some part of it.

/cc @sthaha
if you know if there is any other git trickery i can use to detect
file changes between the 'main' branch and the PR

/cc @bobcatfish
cf #373 discussion

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/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 23, 2020
@tekton-robot tekton-robot requested a review from sthaha June 23, 2020 08:34
@tekton-robot
Copy link

@chmouel: GitHub didn't allow me to request PR reviews from the following users: you, there, is, other, detect, -, to, git, trickery, i, can, use, if, know.

Note that only tektoncd members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Changes

Detecting the tasks that only has been modified or added and test only those in
PR. This will improve the speed of each PR iteration.

/hold

/cc @sthaha - if you know if there is any other git trickery i can use to detect
file changes between the 'main' branch and the PR

/cc @bobcatfish cf #373 discussion

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.

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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 23, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from 44f1233 to 33f58bc Compare June 23, 2020 08:54
@vdemeester
Copy link
Member

/cc @sbwsg @afrittoli

@tekton-robot tekton-robot requested review from afrittoli and a user June 23, 2020 08:55
@chmouel chmouel force-pushed the test-only-changed-test branch from 33f58bc to 04eafdd Compare June 23, 2020 09:01
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
/meow
😻

@tekton-robot
Copy link

@vdemeester: cat image

In response to this:

/lgtm
/meow
😻

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 lgtm Indicates that a PR is ready to be merged. label Jun 23, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from 04eafdd to bdf8b50 Compare June 23, 2020 09:12
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from bdf8b50 to 128e4fb Compare June 23, 2020 09:22
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 23, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from 128e4fb to b81301b Compare June 23, 2020 09:29
@chmouel
Copy link
Member Author

chmouel commented Jun 23, 2020

Seems to work okay, it only detect the change in curl and wget :

+ all_tests='curl/tests
wget/tests'
...
+ test_task_creation curl/tests wget/tests

(i had another test that test as well new addition)

I am not detecting the changes for test_yaml_creation, I will add a further PR to add it but it's not such a big problem currently since those tests are pretty quick to execute compared to the integration tests

I think we would probably want some full integration weekly test run still, we may have set this up from the plumbing repository.

/hold cancel

@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 23, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from b81301b to b22e6ef Compare June 23, 2020 09:47
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

While I understand the reason behind this, I fear this may come back and bite us, at least until we only have one repo for catalog. Many tasks will not change a lot over time, so they won't be tested for potentially long time - when the time comes to actually change something they might be not usable anymore.

So, while I agree this is good to have, I think at the same time we need to setup some way to run all the tests, either on demand, or periodically. Perhaps we should have an "info only" catalog test running on pipeline changes, or one that could be triggered on demand.

@chmouel chmouel force-pushed the test-only-changed-test branch from b22e6ef to 341e233 Compare June 23, 2020 10:02
@chmouel
Copy link
Member Author

chmouel commented Jun 23, 2020

So, while I agree this is good to have, I think at the same time we need to setup some way to run all the tests, either on demand, or periodically. Perhaps we should have an "info only" catalog test running on pipeline changes, or one that could be triggered on demand.

Yes agreed this is what i was mentioning in my comment here we would need to have some weekly periodic jobs for this...

I am not so sure if we can tell to prow something like this

/test integration-test eveyrthing

and have the argument everything get passed down to the e2e script. If that's possible we could allow contributors/reviewers to launch a full test when they think this should be appropriate.

I am not so sure I understand what do you mean by "info only"

@chmouel
Copy link
Member Author

chmouel commented Jun 23, 2020

Further note, the integration tests before this PR is taking 20mn to run, if we are adding pipeline supported version matrix this time would exponentially grow pretty big

@bobcatfish
Copy link
Contributor

Further note, the integration tests before this PR is taking 20mn to run, if we are adding pipeline supported version matrix this time would exponentially grow pretty big

only if they run one at a time :D

@bobcatfish
Copy link
Contributor

i wonder if doing this will prevent us from catching issues - for example if we bump the version of tekton pipelines the tests are using, but we don't run any of the tests, we wont catch any problems 🤔

maybe we can add a nightly run of the tests to make up for it?

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 24, 2020
@chmouel
Copy link
Member Author

chmouel commented Jun 24, 2020

I have added cc4b6f0 so we can define the variable TEST_RUN_ALL_TESTS to force tests everything....

Now to figure out on how to add a nightly catalog job in openshift/plumbing

@chmouel chmouel force-pushed the test-only-changed-test branch from 16e1352 to cc4b6f0 Compare June 24, 2020 08:21
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 24, 2020
test/e2e-tests.sh Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2020
@chmouel
Copy link
Member Author

chmouel commented Jul 20, 2020

/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 Jul 20, 2020
@popcor255
Copy link
Member

All tests are isolated in the given namespace. They are created at the begging of tests and cleaned up at the end of tests. Since, namespace are fairly predictable "local tns="${testname}-${version}". Maybe we should clean up all the resources in the namespace and not the namespace itself when the test ends. We should maybe have a task at the begging of the test suite to clean up old namespaces. At which point we only run tests if the namespace does not exist.
line 107 (e2e-common.sh)

local tns="${testname}-${version}"

I am spit balling here, tbh. Just trying to give a suggesiton.

@chmouel chmouel force-pushed the test-only-changed-test branch from cc4b6f0 to 5f3a71d Compare October 22, 2020 15:52
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 22, 2020
@chmouel chmouel force-pushed the test-only-changed-test branch from 5f3a71d to ef36de7 Compare October 22, 2020 18:51
test/e2e-tests.sh Show resolved Hide resolved
@tekton-robot
Copy link

[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 Oct 23, 2020
We are detecting the task that only has been modified or added with the help of
git diff against the 'main' branch.

If we set and define the variable TEST_RUN_ALL_TESTS it will force running all
the tests and not just the modified ones.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the test-only-changed-test branch from ef36de7 to 867ab4d Compare October 23, 2020 11:55
@chmouel
Copy link
Member Author

chmouel commented Oct 23, 2020

/hold cancel

this was tested as working, i have added previously a commit to this pr which had a change in the task/trigger-jenkins-job and it properly tested only that task

@vdemeester we are good to update the periodic jobs too.

@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 Oct 23, 2020
@piyush-garg
Copy link
Contributor

lgtm

@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2020
@tekton-robot tekton-robot merged commit 5412a08 into tektoncd:master Oct 28, 2020
@chmouel chmouel deleted the test-only-changed-test branch October 28, 2020 20:51
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. 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.

8 participants