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

Allow passing in Finally Tasks to TestIsSkipped #3744

Closed
wants to merge 1 commit into from

Conversation

jerop
Copy link
Member

@jerop jerop commented Feb 2, 2021

Changes

Currently, TestIsSkipped defaults to Finally Tasks being empty in the
PipelineRunFacts

In this change, we add allow passing in Finally Tasks in the test cases
in TestIsSkipped

This would be useful for testing skipping of Finally Tasks when their
WhenExpressions evaluate to false, which would be supported in #3738

/kind misc

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.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

NONE

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Feb 2, 2021
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign jerop
You can assign the PR to them by writing /assign @jerop in a comment when ready.

The full list of commands accepted by this bot can be found 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 requested a review from a user February 2, 2021 23:49
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 2, 2021
@jerop jerop mentioned this pull request Feb 2, 2021
4 tasks
@pritidesai
Copy link
Member

Currently, TestIsSkipped defaults to Finally Tasks being empty in the PipelineRunFacts

Hey @jerop, the finally tasks can not have any dependencies and that's why the graph build function was updated to separate the dependencies from that function in PR - #3583.

@pritidesai
Copy link
Member

Dependencies are set to help schedule that task and making sure all the dependencies are executed before scheduling it. finally tasks are always scheduled after all dag tasks done.

@jerop jerop force-pushed the test-is-skipped branch 2 times, most recently from 4ee072f to f20b192 Compare February 3, 2021 00:49
@jerop
Copy link
Member Author

jerop commented Feb 3, 2021

Hey @jerop, the finally tasks can not have any dependencies and that's why the graph build function was updated to separate the dependencies from that function in PR - #3583.

thanks @pritidesai -- I've added dagFromFinallyTasks to build dag from finally tasks in pipelinerunresolution_test.go

func dagFromFinallyTasks(state PipelineRunState) (*dag.Graph, error) {
fpts := []v1beta1.PipelineTask{}
for _, rprt := range state {
fpts = append(fpts, *rprt.PipelineTask)
}
return dag.Build(v1beta1.PipelineTaskList(fpts), map[string][]string{})
}

Currently, `TestIsSkipped` defaults to `Finally Tasks` being empty in the
`PipelineRunFacts`

In this change, we add allow passing in `Finally Tasks` in the test cases
in `TestIsSkipped`

This would be useful for testing skipping of `Finally Tasks` when their
`WhenExpressions` evaluate to false, which would be supported soon
@jerop jerop closed this Feb 3, 2021
@jerop jerop deleted the test-is-skipped branch June 11, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/misc Categorizes issue or PR as a miscellaneuous one. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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