From 9f3ab5b12ac609520df94e454b68f51f3b26c51d Mon Sep 17 00:00:00 2001 From: Romeo Kienzler Date: Tue, 30 Jun 2026 15:05:29 +0200 Subject: [PATCH] test: fix iterate2 integration test for refactored CLI The integration test invoked 'iterate' with flags removed in the iterate2 refactor (--root-dir, --wlm, --metric, --gpu-count, --cpu-count, --mem-gb), causing 'unrecognized arguments' and a failing Integration Tests workflow on every push. Those settings are now driven by the HPO YAML (the metric lives in its 'metrics:' section). - Drop the stale flags from the test command. - Mark examples/bumpy_function.py executable: iterate2 runs the trial script directly via subprocess ([script]), so it needs the +x bit; without it the run died with PermissionError. Verified: pytest tests/unit/test_iterate2.py passes (10 trials, exit 0). Co-Authored-By: Claude Opus 4.8 Signed-off-by: Romeo Kienzler --- examples/bumpy_function.py | 0 tests/unit/test_iterate2.py | 11 ++++------- 2 files changed, 4 insertions(+), 7 deletions(-) mode change 100644 => 100755 examples/bumpy_function.py diff --git a/examples/bumpy_function.py b/examples/bumpy_function.py old mode 100644 new mode 100755 diff --git a/tests/unit/test_iterate2.py b/tests/unit/test_iterate2.py index cb0fe225..15360b93 100644 --- a/tests/unit/test_iterate2.py +++ b/tests/unit/test_iterate2.py @@ -1,19 +1,16 @@ import os def test_iterate2( ): + # Note: the metric (yval) is declared in the 'metrics:' section of the + # HPO YAML; the iterate2 CLI no longer takes --metric / --root-dir / + # --wlm / --gpu-count / --cpu-count / --mem-gb (removed in the refactor). script = """ iterate \ --script ./examples/bumpy_function.py \ - --root-dir . \ --optuna-study-name hpo \ --optuna-db-path "sqlite:///iterate_study.db" \ --hpo-yaml examples/bumpy_hpo.yaml \ - --optuna-n-trials 10 \ - --wlm none \ - --metric yval \ - --gpu-count 0 \ - --cpu-count 1 \ - --mem-gb 1 + --optuna-n-trials 10 """ ret = os.system(script) assert ret == 0 \ No newline at end of file