Commit 05e788a
committed
feature: implement PinP reconciliation and tests
[TEP-0056]: Third PR of Pipelines-in-Pipelines feature implementation.
Child `PipelineRuns` (PinP) are created by the `PipelineRun` reconciler,
equal to the `TaskRun/CustomRun` implementations.
An event handler for child `PipelineRuns` is registered in controller
entrypoint. This will trigger the reconciliation loop when child
`PipelineRuns` change their state.
Extend `resolvePipelineState` with getter for child `PipelineRuns` using
lister and extend `runNextSchedulableTask` with a condition check for a
`PipelineTask` which is a `Pipeline` and implement the creation of
a new `PipelineRun` from the resolved pipeline state and pipeline facts.
Setting the `ChildReferences` was extended for child `PipelineRuns`.
Rename label/annotation factory.
The unit/e2e test framework was refactored and extended to prepare for
future tests. The test setup is a parent pipeline with one or more
embedded child/grandchild pipelines using the `PipelineSpec` (alpha)
field. It follows the given-when-then test flow arrangement.
The pipeline manifests yaml definitions use variables for every field
which is validated. Multiple helper functions were created equal to
reconciliation unit tests for TaskRuns/CustomRuns.
Test data factory functions were put in the `testing` package in the
`factory.go` file.
The unit tests validates:
- the status and condition of the parent PipelineRuns which should
trigger the creation of the child PipelineRuns,
- the actual created child/grandchild PipelineRuns if they have the correct
metadata i.e. name, owner reference, etc. and the embedded pipelines
from the `PipelineSpec` fields in the pipeline tasks of the parent
pipeline.
Similar checks are performed in `TestReconcile` for `TaskRun` and in
`TestReconcile_V1Beta1CustomTask` for `CustomTasks`.
The e2e tests validate:
- parent PipelineRun creation,
- child PipelineRun creation,
- successful finish of all resources,
- correct label and annotation propagation,
- amount of events published.
Similar checks are performed in
`TestPipelineRun|TestPipelineRunStatusSpec|...` for `TaskRun` and in
`TestCustomTask` for `CustomTask`.
Issues #8760, #7166.
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>1 parent d8f7b93 commit 05e788a
File tree
9 files changed
+1349
-34
lines changed- pkg/reconciler
- pipelinerun
- testing
- test
- parse
9 files changed
+1349
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
| |||
Large diffs are not rendered by default.
0 commit comments