Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Core Reconciler tests and easy-to-reuse Resolver test harnesses #39

Closed
ghost opened this issue Apr 7, 2022 · 1 comment · Fixed by #51
Closed

Core Reconciler tests and easy-to-reuse Resolver test harnesses #39

ghost opened this issue Apr 7, 2022 · 1 comment · Fixed by #51
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@ghost
Copy link

ghost commented Apr 7, 2022

Feature request

Testing reconcilers requires quite a bit of setup code which we don't have yet for this project. This is an important short-term problem for three different classes of test:

  1. The core ResolutionRequest reconciler, though relatively small, needs thorough test coverage
  2. The "resolver framework" needs to have the contracts (interfaces) it exposes tested to ensure they work consistently for all resolvers.
  3. Resolver developers need a pain-free way of spinning up a test harness so that they can quickly add coverage to new resolvers.

Use case

Primarily concerned here with supporting developers of new resolvers by giving them a pain-free-as-possible way for them to exercise their resolver code quickly and easily.

Since a resolver is just a reconciler under the hood hopefully we can find a way to provide a Resolver Test Harness that is general purpose for anyone's resolver development.

Inspiration

The Tekton Pipelines unit test suite includes a plethora of setup code that performs all the necessary injection gubbins to support testing their Reconcilers. This might be a good first place to look for inspiration: https://github.com/tektoncd/pipeline/blob/main/test/controller.go

@ghost ghost added kind/feature Categorizes issue or PR as related to a new feature. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 7, 2022
@abayer
Copy link
Contributor

abayer commented May 18, 2022

/assign

abayer added a commit to abayer/resolution that referenced this issue May 18, 2022
Part of tektoncd#39

Along with some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/resolution that referenced this issue May 19, 2022
Part of tektoncd#39

Along with some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/resolution that referenced this issue May 19, 2022
Part of tektoncd#39

Along with some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/resolution that referenced this issue May 25, 2022
Part of tektoncd#39

Along with some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/resolution that referenced this issue May 31, 2022
Part of tektoncd#39

Tests are added for `pkg/resolver/framework/reconciler.go` and `pkg/reconciler/resolutionrequest/resolution.request.go`, as well as the new framework for testing `Resolver`s in `pkg/resolver/framework/testing`, with tests using that in `gitresolver/pkg/git/resolver_test.go` and `docs/resolver-template/cmd/demoresolver/main_test.go`.

In addition, e2e tests are reorganized a bit, and I added some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit that referenced this issue Jun 1, 2022
Part of #39

Tests are added for `pkg/resolver/framework/reconciler.go` and `pkg/reconciler/resolutionrequest/resolution.request.go`, as well as the new framework for testing `Resolver`s in `pkg/resolver/framework/testing`, with tests using that in `gitresolver/pkg/git/resolver_test.go` and `docs/resolver-template/cmd/demoresolver/main_test.go`.

In addition, e2e tests are reorganized a bit, and I added some other tooling derived from what we've got in Pipeline.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant