Commit Graph

40 Commits

Author SHA1 Message Date
Sky Singh a7fd941815
chore(dependencies): Upgrade Ginkgo to v2 and update indirect dependencies
- Updated Ginkgo from v1.16.5 to v2.19.0 for improved features and compatibility.
- Added new indirect dependencies including `github.com/go-logr/logr`, `github.com/go-task/slim-sprig/v3`, and `github.com/google/pprof`.
- Ensured consistency in dependency management within go.mod and go.sum files.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 10:05:06 +05:30
Sky Singh a4e22b27b6
chore(workflow): Modify release workflow trigger and clean up experiment test code
- Changed the release workflow trigger from `create` to `push` for tags matching the pattern `v*`, ensuring proper versioning during releases.
- Removed unused code and debug log functions from the container-kill experiment test file to enhance clarity and maintainability.
- Updated default application namespace and label in the experiment configuration for better alignment with standard practices.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:38:17 +05:30
Sky Singh f5406b0be1
chore(tests): Standardize comments and formatting in experiment test files
- Added spaces after comment slashes for better readability in various experiment test files, including container-kill, disk-fill, node-cpu-hog, and others.
- Ensured consistent formatting across all test files to enhance code clarity and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:30:09 +05:30
Sky Singh a98c455e4a
fix(tests): Refactor log retrieval in container-kill experiment for improved error handling
- Moved the `getSubscriberPodLogs` function call to ensure logs are retrieved consistently during polling for experiment run status and when the experiment is stuck in the queued state.
- This change enhances the visibility of logs during error scenarios, aiding in debugging efforts.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:49:19 +05:30
Sky Singh 3fa52b404b
fix(tests): Add log retrieval in container-kill experiment for error handling
- Integrated the `getSubscriberPodLogs` function to fetch and log subscriber pod logs when an error occurs while fetching the experiment run status.
- This enhancement improves error visibility and aids in debugging during the container-kill experiment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:18:54 +05:30
Sky Singh b94bfc4dcd
feat(tests): Add helper function for enhanced debugging in container-kill experiment
- Introduced a new helper function `getSubscriberPodLogs` to retrieve and log the status of various components in the Litmus namespace, including subscriber pod logs, workflow controller logs, chaos operator logs, and the status of pods and workflows.
- Improved debugging capabilities by providing detailed logs for better visibility during the container-kill experiment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:12:44 +05:30
Sky Singh fd9b53ca2b
feat(tests): Enhance logging and retry mechanism in container-kill experiment tests
- Improved logging for experiment creation and polling for experiment runs, providing detailed information about the experiment ID, infrastructure ID, and project ID.
- Increased the maximum number of polling retries from 10 to 20 and adjusted the polling interval from 3 seconds to 5 seconds for better reliability.
- Added detailed logging of experiment run attempts, including specific run details for improved debugging and visibility.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 14:05:08 +05:30
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 c92f94403f
refactor(experiments): Integrate Litmus SDK client in chaos experiment tests
- Replaced environment.ClientSets with Litmus SDK client in pod-delete experiment tests 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 5e7b0426fc
refactor(experiments): Update chaos experiment tests and request construction
- Removed uuid dependency from chaos experiment tests (node-cpu-hog, node-io-stress, node-memory-hog) to streamline imports.
- Commented out kubeconfig retrieval and clientset generation in tests for improved clarity.
- Enhanced experiment request construction by utilizing pkg functions to generate unique experiment names and IDs, improving maintainability.
- Added logic to set ConnectedInfraID from ExistingInfraID if not already set, enhancing infrastructure setup reliability.
- Updated GetDefaultExperimentConfig to include new chaos experiment types and their specific configurations, ensuring comprehensive support for node chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 978b690328
refactor(experiments): Remove NODE_LABEL from chaos experiment environment variables
- Eliminated NODE_LABEL from the environment variables in multiple chaos experiment tests (disk-fill, node-cpu-hog, node-io-stress, node-memory-hog) to streamline configuration.
- Implemented logic to filter out NODE_LABEL if it is empty, enhancing the flexibility of experiment configurations.
- Updated the GetExperimentManifest function to handle NODE_LABEL removal in the manifest generation process, ensuring cleaner manifests.
- Improved overall maintainability and clarity of chaos experiment tests by reducing unnecessary environment variables.

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 997c5eec78
refactor(experiments): Add probe configuration support to pod-delete experiment
- Introduced probe configuration options in ExperimentDetails, allowing for dynamic probe creation during the pod-delete experiment.
- Updated the GetENV function to read new environment variables related to probe settings.
- Enhanced the pod-delete experiment test to set up and clean up probes based on the new configuration.
- Implemented CreateProbe and CleanupProbe functions to manage probe lifecycle, improving experiment flexibility and maintainability.

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 dc8240d639
refactor(experiments): Enhance network chaos experiments with modular request construction
- Updated pod network experiments (corruption, latency, loss, duplication) to utilize the workflow package for constructing experiment requests.
- Improved logging consistency by replacing log statements with klog across all network chaos tests.
- Modularized experiment request construction to dynamically generate unique experiment names and IDs, enhancing maintainability.
- 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 network chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 1ec44ef3ca
refactor(experiments): Update pod CPU and memory hog tests for improved SDK integration
- Commented out kubeconfig retrieval and clientset generation in both pod-cpu-hog and pod-memory-hog tests for clarity.
- Enhanced logging by replacing log with klog for better consistency across experiments.
- Modularized experiment request construction by utilizing the workflow package for generating unique experiment names and IDs.
- Improved error handling during experiment creation and run status polling, ensuring dynamic fetching of the latest experiment run ID.
- Updated the test descriptions for better readability and consistency.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 6e252fea28
refactor(experiments): Modularize pod-delete experiment request construction
- Moved the pod-delete experiment request construction logic to a new workflow package for better organization and reusability.
- Introduced a templated approach for generating Argo Workflow manifests, allowing for dynamic parameter handling.
- Enhanced the ExperimentConfig structure to encapsulate experiment-specific configurations.
- Updated the test to utilize the new workflow functions, improving clarity and maintainability of the experiment execution process.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh bf5174a8ca
refactor(experiments): Enhance pod-delete experiment request construction with templating
- Replaced static Argo Workflow manifest with a templated approach for dynamic parameter handling.
- Improved metadata handling by utilizing template data structure for experiment details.
- Streamlined the construction of the experiment request, enhancing clarity and maintainability.
- Updated logging to provide better insights during the experiment request creation process.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 72458457d7
refactor(experiments): Update pod-delete experiment test for improved SDK integration
- Replaced the experiment saving logic with a direct creation method for better clarity and error handling.
- Enhanced the experiment run status polling by fetching the latest run ID dynamically.
- Improved logging to provide clearer insights during experiment execution and status checks.
- Updated the experiment request construction to ensure proper handling of experiment run IDs and statuses.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh c5a983c957
refactor(experiments): Improve pod-delete experiment request handling
- Replaced UUID generation with a unique experiment name generation function for better clarity.
- Updated the Argo Workflow manifest to dynamically set the experiment name and improved metadata handling.
- Enhanced logging to provide clearer insights during experiment request construction.
- Streamlined the manifest parsing logic to ensure consistent naming conventions across the experiment lifecycle.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 1a8fe34215
chore(dependencies): Update go.mod and go.sum for litmus-go-sdk
- Added a local replacement for github.com/litmuschaos/litmus-go-sdk in go.mod, to be removed after the SDK is published.
- Updated go.sum to reflect the changes in dependencies and their versions.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 3c1a24e20c
refactor(experiments): Enhance pod-delete experiment request construction
- Introduced a unique experiment name generation using UUID for better identification.
- Updated the Argo Workflow manifest to include proper JSON escaping and dynamic parameters.
- Refactored the manifest parsing logic to modify metadata and workflow names dynamically.
- Improved error handling during manifest parsing and JSON conversion.

This refactor enhances clarity and maintainability of the pod-delete experiment request construction.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh dad271c4f7
refactor(experiments): Update pod-delete experiment test and clientset logic
- Commented out kubeconfig retrieval and clientset generation in the pod-delete experiment test for clarity.
- Enhanced infrastructure setup logic to manually set ConnectedInfraID when using existing infrastructure.
- Refactored clientset generation to retrieve the token using the Auth() method, improving error handling and logging for token retrieval.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 7961f90cd2
feat(experiments): Refactor experiment phase checks to use utility function
- Introduce a new utility function, ContainsString, in the pkg module to streamline the checking of final phases in various experiment tests.
- Replace the previous manual phase checking logic with the new utility function across multiple experiment test files, enhancing code clarity and maintainability.
- Ensure consistent handling of final phase validation for improved status checks in experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 44b7167df9
feat(experiments): Refactor pod-delete experiment request to use Argo Workflow manifest
- Replace the previous method of fetching the engine template from an external source with a direct construction of an Argo Workflow manifest for Litmus 3.0.
- Update the manifest to include dynamic parameters for experiment execution, enhancing clarity and maintainability.
- Remove unnecessary HTTP requests and YAML parsing, streamlining the experiment request construction process.

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 e2143754fd
refactor(experiments): Update pod-cpu-hog and pod-delete tests to use final phase string
- Replace usage of final status object with final phase string for polling experiment run status.
- Enhance validation checks to ensure final phase is not empty and equals "Completed" after polling.
- Improve code clarity and maintainability by simplifying the status handling in both experiment tests.

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 a07e059e6b
feat(infrastructure): Refactor chaos experiment infrastructure management with new module
- Introduce a new `infrastructure` package to handle setup and disconnection of infrastructure for chaos experiments.
- Update experiment test files to utilize the new infrastructure management functions, improving code clarity and maintainability.
- Add new environment variables for controlling infrastructure installation and usage of existing infrastructure.
- Update `go.mod` and `go.sum` to reflect changes in dependencies.

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
Sky Singh 67e84d3491
feat(experiments): Refactor pod-delete experiment request construction to fetch template from external source
- Introduce HTTP fetching of the engine template for the pod-delete experiment.
- Update the manifest construction logic to modify the fetched YAML template with experiment details.
- Replace the placeholder manifest with a dynamic template that adapts based on input parameters.
- Enhance error handling for template fetching and parsing.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh dce1d73c11
chore(experiments): Update pod-delete experiment to utilize Litmus SDK for experiment execution
- Integrate the use of the Litmus SDK for creating and running the pod-delete experiment.
- Refactor test setup to include infrastructure connection and experiment request construction.
- Add new helper function to construct experiment requests with proper manifest YAML.
- Update go.mod and go.sum to include the latest version of github.com/google/uuid.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-28 17:46:37 +05:30
Sky Singh 7c40dfc898
chore(experiments): Enhance pod-delete experiment with SDK infrastructure connection
- Add support for connecting to ChaosCenter infrastructure via SDK in the pod-delete experiment.
- Introduce new environment variables for infrastructure configuration.
- Refactor test setup to include infrastructure connection checks and cleanup.
- Update go.mod to include the necessary Litmus SDK dependency.

Signed-off-by: [Your Name] [Your Email]
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