Skip to content

Harden rf3_partial argv test against baked pixi env detection #287

Description

@coderabbitai

Summary

The argv assertion in tests/runs/test_runner.py (test_argv_for_rf3_partial_matches_bash, around Line 29) was relaxed to check the run_grid_search.py script path by substring instead of an exact match. However, runner._build_argv() switches to a direct Python executable whenever a baked pixi env (e.g. .pixi/envs/rf3/bin/python) is detected on the machine running the tests. This means the test can still fail non-deterministically on machines/CI runners that already have a baked pixi env, even with the looser substring check, because the ["pixi", "run", -e", "rf3", "python"] prefix assertion assumes the pixi code path is always taken.

Required change

  • In tests/runs/test_runner.py, force the pixi code path before asserting the ["pixi", "run", "-e", "rf3", "python"] prefix, e.g. via monkeypatch.setenv("SAMPLEWORKS_FORCE_PIXI", "1") in test_argv_for_rf3_partial_matches_bash.
  • Verify no other tests in the same file rely on the default (non-forced) baked-env detection behavior in a way that would be affected.

Affected files

  • tests/runs/test_runner.py

Acceptance criteria

  • test_argv_for_rf3_partial_matches_bash passes deterministically regardless of whether a baked pixi env exists on the test-running machine.
  • No regression to other runner tests that intentionally exercise baked-env detection (e.g. test_uses_baked_env_python_when_available).

References

Requested by: @marcuscollins

cc: @manzuoni-astera @xraymemory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions