Commit Graph

13 Commits

Author SHA1 Message Date
Sky Singh 020d7400aa
refactor(experiments): Remove manual setting of ConnectedInfraID in chaos experiment tests
- Eliminated the logic for manually setting ConnectedInfraID from ExistingInfraID in multiple chaos experiment tests (container-kill, disk-fill, node-cpu-hog, node-io-stress, node-memory-hog, pod-autoscaler, pod-cpu-hog, pod-memory-hog, pod-network-corruption, pod-network-duplication, pod-network-latency, pod-network-loss, pod-delete).
- This change simplifies the infrastructure setup process by relying on the updated logic in the SetupInfrastructure function, enhancing code clarity and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 8741dd40e0
refactor(experiments): Remove HTTP fetching and YAML parsing from chaos experiment requests
- Eliminated HTTP fetching and YAML parsing logic from the chaos experiment request construction functions in multiple tests (container-kill, node-cpu-hog, node-io-stress, node-memory-hog, pod-cpu-hog, pod-memory-hog).
- Streamlined the experiment request construction process by removing unnecessary dependencies and simplifying the code structure.
- Improved overall maintainability and clarity of chaos experiment tests by focusing on essential functionalities.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh c90bbf7d7f
refactor(experiments): Integrate Litmus SDK client across chaos experiment tests
- Replaced environment.ClientSets with Litmus SDK client in various chaos experiment tests (container-kill, disk-fill, node-cpu-hog, node-io-stress, node-memory-hog, pod-autoscaler, pod-cpu-hog, pod-memory-hog, pod-network-corruption, pod-network-duplication, pod-network-latency, pod-network-loss) for improved clarity and maintainability.
- Updated SetupInfrastructure and DisconnectInfrastructure functions to utilize the new SDK client, enhancing infrastructure management.
- Streamlined experiment run polling and status checking by leveraging the SDK client, ensuring consistent error handling and logging.
- Enhanced CreateProbe function to utilize the SDK client for probe creation, improving flexibility in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh f10a08cf04
refactor(experiments): Integrate probe setup and cleanup in chaos experiment tests
- Added support for probe configuration in various chaos experiment tests (container-kill, disk-fill, node-cpu-hog, node-io-stress, node-memory-hog, pod-autoscaler, pod-cpu-hog, pod-memory-hog, pod-network-corruption, pod-network-duplication, pod-network-latency, pod-network-loss).
- Implemented logic to create and validate probes before running experiments, enhancing flexibility and reliability.
- Included cleanup procedures for probes after experiment execution to ensure proper resource management.
- Enhanced logging for probe setup and cleanup processes to improve traceability during test execution.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 96cd6c0456
refactor(experiments): Replace ioutil with io for reading data in chaos experiment tests
- Updated multiple chaos experiment tests (container-kill, disk-fill, node-cpu-hog, node-io-stress, node-memory-hog, pod-cpu-hog, pod-memory-hog) to replace ioutil.ReadAll with io.ReadAll for improved performance and consistency.
- Modified file handling in pkg/file.go and pkg/install.go to utilize os.ReadFile and os.WriteFile, enhancing clarity and maintainability.
- Ensured consistent error handling and logging across all updated tests.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 4ed793b23f
refactor(experiments): Implement polling for experiment run availability in chaos tests
- Updated various chaos experiment tests (container-kill, disk-fill, pod-autoscaler, pod-cpu-hog, pod-memory-hog, pod-network-corruption, pod-network-duplication, pod-network-latency, pod-network-loss) to include a polling mechanism for checking the availability of experiment runs.
- Enhanced logging to provide detailed insights during the polling process, including retry attempts and found experiment run IDs.
- Removed commented-out kubeconfig retrieval and clientset generation for improved clarity and maintainability.
- Ensured consistent error handling and expectations during experiment run status checks across all updated tests.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh e93a7d4380
refactor(experiments): Modularize chaos experiment request construction and enhance logging
- Updated container-kill, disk-fill, and pod-autoscaler experiments to utilize the workflow package for constructing experiment requests, improving maintainability.
- Replaced log statements with klog for consistent logging across all chaos experiments.
- Enhanced error handling during experiment creation and run status polling, ensuring accurate fetching of the latest experiment run ID.
- Updated test descriptions for better clarity and consistency across chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh f6bfc60878
feat(experiments): Update experiment timeout and polling interval configurations
- Refactor experiment test files to utilize dynamic timeout and polling interval values from environment variables.
- Enhance error messages to reflect the actual timeout duration for better debugging.
- Extend final phase checks to include "Completed_With_Error" and "Terminated" for improved status validation.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 7d68fc3552
feat(experiments): Refactor chaos experiment tests to utilize new infrastructure management module
- Update all experiment test files to replace direct SDK infrastructure connection logic with the new `infrastructure` module for setup and cleanup.
- Enhance code clarity and maintainability by centralizing infrastructure management.
- Validate infrastructure ID after setup to ensure proper connection.
- Ensure consistent error handling across all experiments during infrastructure operations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 61dadcc036
feat(experiments): Enhance chaos experiments with Litmus SDK integration and dependency updates
- Add support for the `github.com/google/uuid` package to generate unique identifiers in experiments.
- Update experiment test files to utilize the Litmus SDK for constructing and executing chaos experiments.
- Refactor YAML manifest construction logic to dynamically set experiment parameters based on input details.
- Introduce new environment variables and enhance error handling for manifest generation.
- Update `go.mod` to include the latest version of `github.com/google/uuid` and `sigs.k8s.io/yaml`.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Aarushi 787c7aa7d8
check for resources in chaos namespace, with APP NS as a backup (#80)
Signed-off-by: Aarushi Kansal <aarushi.k@hotmail.com>
2022-07-28 14:36:20 +05:30
Udit Gaurav 1b2c0e34ac
Chore(engine): Enhance Chaos CI Lib Experiment Execution and add E2E (#19)
* Chore(engine): Enhance Chaos CI Lib Experiment Execution and add E2E

Signed-off-by: udit <udit@chaosnative.com>
2021-07-14 10:24:33 +05:30
Udit Gaurav c97002167c Chore(refactor): Modify Chaos CI Lib use actions, remove vendors, refactor code (#10)
* Chore(refactor): Modify Chaos CI Lib use actions, remove vendors, refactor code

Signed-off-by: uditgaurav <udit@chaosnative.com>

* Inital commit to the repo

Signed-off-by: uditgaurav <udit@chaosnative.com>
2021-05-28 04:06:19 +05:30