Add unit tests for applierGroup.Get in Kubernetes executor
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
Description
Currently, there is no unit test coverage for the routing logic in the applierGroup.Get method. The production code has a pending comment requesting testing coverage for this component. This issue proposes adding unit tests to verify that the Kubernetes applier is correctly resolved and returned based on matching routes (Kind, Name, Labels, and fallback).
Relevant Code
pkg/app/piped/executor/kubernetes/applier_group.go
Proposed Changes
- Implement
TestApplierGroupGetinapplier_group_test.go. - Cover the following scenarios using mocked appliers:
- Fallback to
defaultApplierwhen routes are empty or matchers don't align. - Successful routing by provider name.
- Multi-applier construction when routing by provider labels.
- Error propagation when matched providers or appliers are missing.
- Fallback to
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/app/piped/executor/kubernetes/applier_group.go and inspect the existing applier_group_test.go before running its package tests. Implement TestApplierGroupGet with mocked appliers covering fallback, provider-name routing, provider-label multi-applier construction, and missing-provider or applier errors. Done means the routing cases and error propagation are covered by passing unit tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100