pipe-cd / pipe-cd/pipecd

Add unit tests for applierGroup.Get in Kubernetes executor

Open
#7,003 0 comments 0 reactions 0 assignees View on GitHub

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 TestApplierGroupGet in applier_group_test.go.
  • Cover the following scenarios using mocked appliers:
    • Fallback to defaultApplier when 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.