Skip to content

test: fix iterate2 integration test for refactored CLI#322

Merged
romeokienzler merged 1 commit into
mainfrom
fix-iterate2-integration-test
Jun 30, 2026
Merged

test: fix iterate2 integration test for refactored CLI#322
romeokienzler merged 1 commit into
mainfrom
fix-iterate2-integration-test

Conversation

@romeokienzler

Copy link
Copy Markdown
Member

Problem

The Integration Tests workflow has been failing on every push to main:

iterate: error: unrecognized arguments: --root-dir . --wlm none --metric yval --gpu-count 0 --cpu-count 1 --mem-gb 1

The iterate2 refactor (commit a1ad3ca) removed those CLI flags — the metric is now declared in the HPO YAML's metrics: section, and the other settings moved into the YAML / plugin system. The test in tests/unit/test_iterate2.py was never updated.

Fix

  1. Drop the stale flags from the test's iterate command. The current CLI accepts only --script, --hpo-yaml, --optuna-study-name, --optuna-db-path, --optuna-n-trials, --parallelism, --log-level.
  2. Mark examples/bumpy_function.py executable (100644 → 100755). iterate2 runs the trial script directly via subprocess.Popen([script]), so it needs the +x bit — without it the run died with PermissionError even after the args were fixed.

Verification

$ pytest tests/unit/test_iterate2.py -q
1 passed in 1.31s

Ran end-to-end locally: all 10 Optuna trials execute and the launcher exits 0. (Trial values near 0.0 are expected — the bumpy function's global optimum is a narrow peak at (23,42,66), so random points score ~0.)

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Signed-off-by: Romeo Kienzler <romeo.kienzler1@ibm.com>
@romeokienzler romeokienzler merged commit f49c252 into main Jun 30, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant