-
-
Notifications
You must be signed in to change notification settings - Fork 4
chore: improve test coverage #1771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nikolai Emil Damm <[email protected]>
✅
|
Signed-off-by: Nikolai Emil Damm <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: Nikolai Emil Damm <[email protected]>
…handling Signed-off-by: Nikolai Emil Damm <[email protected]>
…scenarios Signed-off-by: Nikolai Emil Damm <[email protected]>
Signed-off-by: Nikolai Emil Damm <[email protected]>
…x installer - Implement unit tests for marshalling and unmarshalling of nested structures in YAML marshaller. - Enhance existing tests with cases for special characters, unicode, and negative values. - Introduce tests for round-trip marshalling and unmarshalling for both simple and nested models. - Create test wrappers for internal functions in the flux installer package to facilitate testing. - Add unit tests for FluxInstance deep copy methods and ensure proper functionality. - Implement tests for building Docker config JSON, external registry URLs, and local registry URLs. - Validate the behavior of transient API error handling and polling until resources are ready. - Ensure default resources are correctly handled with nil configurations. Signed-off-by: Nikolai Emil Damm <[email protected]>
Signed-off-by: Nikolai Emil Damm <[email protected]>
…kages Signed-off-by: Nikolai Emil Damm <[email protected]>
Signed-off-by: Nikolai Emil Damm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request significantly enhances test coverage across the KSail codebase by adding comprehensive unit tests for multiple packages. The changes include new test files for error handling, API types, installer components, Kubernetes utilities, I/O operations, and client packages.
Changes:
- Added extensive unit test coverage for core packages including flux installer, CNI installers (Cilium/Calico), k8s utilities, I/O operations, and API types
- Introduced test export files to expose internal functions for testing in several packages
- Refactored existing test organization for better maintainability
- Minor code cleanup including comment updates and linter exception additions
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/envvar/expand_test.go | Enhanced test cases with parallel execution support and better organization |
| pkg/svc/provisioner/cluster/errors/errors_test.go | New comprehensive error validation tests |
| pkg/svc/provider/provider_test.go | New provider tests using mocks to verify functionality |
| pkg/svc/installer/flux/resources_test.go | Comprehensive flux resource builder tests |
| pkg/svc/installer/flux/fluxinstance_types_test.go | DeepCopy and type validation tests for FluxInstance |
| pkg/svc/installer/flux/export_test.go | Exports internal functions for external testing |
| pkg/svc/installer/cni/cilium/installer_test.go | Enhanced installer tests with snapshot testing |
| pkg/svc/installer/cni/calico/installer_test.go | Enhanced installer tests with snapshot testing |
| pkg/k8s/rest_config_test.go | New tests for REST config building |
| pkg/k8s/multi_resource_test.go | Tests for multi-resource waiting functionality |
| pkg/k8s/kubeconfig_test.go | Comprehensive kubeconfig cleanup tests |
| pkg/k8s/errors_test.go | Error constant validation tests |
| pkg/k8s/apiserver_test.go | API server readiness checking tests |
| pkg/io/validator/metadata_test.go | Metadata validation tests |
| pkg/io/marshaller/yaml_marshaller_test.go | Extended YAML marshalling tests including round-trip |
| pkg/io/generator/talos/generator_test.go | Extensive Talos generator tests for all patches |
| pkg/io/generator/generator_test.go | Refactored test case organization |
| pkg/io/errors_test.go | I/O error validation tests |
| pkg/io/config-manager/helpers_test.go | Added mock provider and additional test cases |
| pkg/client/oci/verifier_test.go | New OCI registry verifier tests |
| pkg/client/docker/registry_helpers_test.go | Comprehensive Docker registry helper tests |
| pkg/client/docker/export_test.go | Exports internal Docker functions for testing |
| pkg/cli/helpers/registry_test.go | Registry helper function tests |
| pkg/apis/cluster/v1alpha1/types_test.go | Extended LocalRegistry method tests |
| pkg/apis/cluster/v1alpha1/marshal_test.go | YAML/JSON marshalling and default pruning tests |
| pkg/apis/cluster/v1alpha1/enums_test.go | Comprehensive enum validation tests |
| pkg/svc/installer/flux/resources.go | Removed obsolete nolint comment |
| pkg/client/oci/verifier.go | Updated comment for clarity |
| .golangci.yml | Added linter exception for test file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Enhance test coverage by adding various test cases. This change aims to improve reliability and maintainability of the codebase.