Skip to content

Commit

Permalink
[TEP-0100] Prepare for testing of minimal status implementation
Browse files Browse the repository at this point in the history
This change is to minimize the size of the actual implementation. We need to change a number of
tests in `pkg/reconciler/pipelinerun/pipelinerun_test.go` to be table-based, so that we can test
behavior under each possible value for the new `embedded-status` feature flag. Here, we just
modify the relevant tests to be table-based and use a parameterized helper function for the actual
execution, with a test case for each value.

It also adds helper functions for checking the relevant fields in the `PipelineRun` status, which
are hard-coded to always handle the current, "full" embedded status approach.

This also splits out `TestUpdatePipelineRunStatusFromTaskRuns` and `TestUpdatePipelineRunStatusFromRuns`
into a separate file, `pipelinerun_updatestatus_test.go`. When the TEP-0100 implementation lands,
this will also contain additional tests for updating via child references. Splitting like this helps
keep `pipelinerun_test.go` from getting even more bloated than it is currently.

Until the implementation, these table-based tests are purely duplicative - they're going to run the
same and check the same things for any value of `embedded-status`, but the implementation PR will be
cleaner, only adding the implementation and changing the helper functions to take all of the
possible "embedded-status" values into account. The changes which need to be made in the
implementation PR are all marked with `// TODO(abayer): ...` in `pipelinerun_test.go` and
`pipelinerun_updatestatus_test.go`.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
  • Loading branch information
abayer committed Apr 4, 2022
1 parent a8a3adf commit 6b66506
Show file tree
Hide file tree
Showing 2 changed files with 1,602 additions and 733 deletions.
Loading

0 comments on commit 6b66506

Please sign in to comment.