Skip to content

Add unit tests across the project#363

Merged
ArangoGutierrez merged 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:unit_ci
May 21, 2025
Merged

Add unit tests across the project#363
ArangoGutierrez merged 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:unit_ci

Conversation

@ArangoGutierrez
Copy link
Collaborator

This pull request introduces comprehensive unit tests across multiple packages to ensure functionality and reliability of YAML/JSON marshaling, provider interfaces, dependency resolution, dry-run validations, and container runtime templates. The changes focus on improving test coverage and validating different configurations and edge cases.

Testing for YAML/JSON marshaling and unmarshaling:

  • Added tests in pkg/jyaml/jyaml_test.go to validate MarshalJSON, MarshalJSONIndent, MarshalYAML, Unmarshal, UnmarshalStrict, and UnmarshalFromFile functions, including scenarios with invalid data and strict mode validation.

Mocking and testing provider interfaces:

  • Introduced MockProvider in pkg/provider/provider_test.go to test the Provider interface, including methods like Create, Delete, DryRun, Status, and UpdateResourcesTags. Added test cases for both successful and error scenarios.

Dependency resolution testing:

  • Implemented tests in pkg/provisioner/dependency_test.go for NewDependencies and its methods (withKubernetes, withContainerRuntime, etc.), as well as the Resolve method to validate dependency resolution logic.

Dry-run validation:

  • Added dry-run tests in pkg/provisioner/dryrun_test.go to validate configurations for Kubernetes versions and container runtimes, including both valid and invalid scenarios.

Container runtime template testing:

@ArangoGutierrez ArangoGutierrez self-assigned this May 21, 2025
@ArangoGutierrez ArangoGutierrez added the testing issue/PR to fix/edit/create/enhance a project unit/e2e test label May 21, 2025
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@ArangoGutierrez ArangoGutierrez merged commit 1097ec9 into NVIDIA:main May 21, 2025
15 checks passed
@ArangoGutierrez ArangoGutierrez added this to the v0.2.8 milestone May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing issue/PR to fix/edit/create/enhance a project unit/e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant