Skip to content

Commit

Permalink
adding tobis ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiscr committed Jan 26, 2024
1 parent 5a3f392 commit e96382e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/contributor/testing-strategy.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
# Testing Strategy
# Testing Strategy Infrastructure-Manager

## Introduction
This testing strategy outlines the approach and methodologies to be used for testing a Kubernetes project built using the Kubebuilder framework. It includes various levels of testing such as unit testing, integration testing, and end-to-end testing to ensure the stability, reliability, and correctness of the project.
## Testing Levels
1. **Unit Testing:** Writing and executing tests for individual functions, methods, and components to verify their behavior and correctness in isolation.
2. **Integration Testing:** Validating the integration and interaction between different components, modules, and services in the project.
3. **End-to-End Testing:** Testing the application as a whole in a production-like environment, mimicking real-world scenarios to ensure the entire system functions correctly.
## Testing Tools and Frameworks
Use the following tools and frameworks to implement the above-mentioned testing levels:
- **Ginkgo and Gomega**: For writing and executing unit tests with a BDD-style syntax and assertions.
- **Kubebuilder Test Framework**: For creating and executing integration tests that interact with the Kubernetes cluster.
- **Helm**: For deploying and managing test clusters and environments for end-to-end testing.
- **Kubernetes clients for Go**: Use the official Kubernetes client libraries to interact with the Kubernetes API and validate the behavior of the project.
## Testing Approach
### Unit Testing
1. Identify critical functions, methods, and components that require testing.
2. Write unit tests using Ginkgo and Gomega frameworks.
3. Ensure tests cover various scenarios, edge cases, and possible failure scenarios.
4. Test for both positive and negative inputs to validate the expected behavior.
5. Mock external dependencies and use stubs or fakes to isolate the unit under test.
6. Run unit tests periodically during development and before each commit to prevent regressions.
### Integration Testing
1. Create a separate test suite for integration testing.
2. Use the Kubebuilder Test Framework to create test cases that interact with the Kubernetes cluster.
3. Test the interaction and integration of your custom resources, controllers, and other components with the Kubernetes API.
4. Ensure test cases cover various aspects such as resource creation, updating, deletion, and handling of edge cases.
5. Validate the correctness of event handling, reconciliation, and other control logic.
### End-to-End Testing
1. Use Helm to create, deploy, and manage test clusters and environments that closely resemble the


The following CI/CD jobs are a part of the development cycle:

Expand Down

0 comments on commit e96382e

Please sign in to comment.