Files
krkn/CI
augmentcode[bot]andlnx01 8265c358d3 test: migrate memory_hog functional test to tests_v2 (closes #1396) (#1397)
* test: migrate memory_hog functional test to tests_v2 (closes #1396)

Add a pytest v2 functional test for the memory hog scenario (hog_scenarios),
mirroring the cpu_hog migration. Covers execution success, node-selector
targeting, duration/memory-size parameter handling, hog pod lifecycle and
cleanup, and graceful failure on invalid selector / invalid config.

- CI/tests_v2/scenarios/memory_hog/test_memory_hog.py: TestMemoryHog with
  functional + memory_hog markers and three no_workload tests.
- CI/tests_v2/scenarios/memory_hog/scenario_base.yaml: flat hog config tuned
  for functional testing (light fixed memory-vm-bytes, short duration).
- Register the memory_hog marker in pytest.ini and document the scenario in
  the tests_v2 README.

* test: extract shared hog-pod/node helpers into tests_v2 lib/utils

Lift the duplicated pod-prefix and schedulable-node helpers out of the cpu_hog and memory_hog test modules into CI/tests_v2/lib/utils.py as parameterized, reusable functions (list_pods_by_prefix, wait_for_scheduled_pod_by_prefix, wait_for_no_pods_by_prefix, schedulable_worker_nodes) and reuse them from both scenarios. Addresses review feedback on #1397.

---------

Co-authored-by: augmentcode[bot] <185243770+augmentcode[bot]@users.noreply.github.com>
2026-06-12 09:02:39 +05:30
..
2025-12-15 11:46:48 -05:00

CI Tests

First steps

Edit functional_tests with tests you want to run

How to run

./CI/run.sh

This will run kraken using python, make sure python3 is set up and configured properly with all requirements

Adding a test case

  1. Add in simple scenario yaml file to execute under ../CI/scenarios/

  2. Copy test_application_outages.sh for example on how to get started

  3. Lines to change for bash script

    a. 11: Set scenario type to be your new scenario name

    b. 12: Add pointer to scenario file for the test

    c. 13: If a post action file is needed; add in pointer

    d. 14: Set filled in config yaml file name specific to your scenario

    e. 15: Make sure name of config in line 14 matches what you pass on this line

  4. Add test name to functional_tests file

    a. This will be the name of the file without ".sh"

  5. If any changes to the main config (other than the scenario list), please be sure to add them into the common_config