kubeslice / kubeslice/kubeslice-controller

Feature: Add Unit Tests for Remaining Core Controllers and Worker Controllers

Open
#257 1 comment 0 reactions 3 assignees Claimed by @richiesebastian View on GitHub
feature
Dominant language
Go
Stars
73
Forks
48
Avg merge
2d 21h
Merged PRs (30d)
8

Description

### 🔖 Feature description

Currently, several core controller files in the controllers/controller and controllers/worker directories do not have corresponding unit tests. Adding unit tests for these components will improve maintainability, detect regressions early, and increase overall test coverage for critical reconciliation logic.

### 🎤 Pitch

In my use-case, improving test coverage for these controllers will:

- Ensure that reconciliation logic behaves correctly across different scenarios.
- Catch bugs earlier in the development lifecycle.
- Increase confidence when making code changes or refactoring.

### ✌️ Solution

I want this feature to:

- Add new _test.go files for missing controller and worker controller implementations.
- Use controller-runtime’s fake.Client to simulate Kubernetes API interactions.
- Follow existing test patterns from other parts of the project to maintain consistency.

### 🔄️ Alternative

I considered relying only on integration tests, but they lack granular coverage of individual controller logic. Unit tests are faster, more targeted, and help catch issues earlier.

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/kubeslice/kubeslice-controller/blob/master/code_of_conduct.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.