Skip to content

[Bug] Platform-specific code and hardcoded paths in test_ernie_image.py break tests on Windows #1697

@Rishabh-Sahni-0809

Description

@Rishabh-Sahni-0809

Description

The newly added ERNIE-Image test script (test_ernie_image.py) contains a few platform-specific testing flaws that break cross-platform compatibility, particularly for Windows (which is a primary OpenVINO target):

  1. Unix-only subprocess commands: The script uses subprocess.run(["rm", "-rf", dir]) to clear output models. This will fail with a FileNotFoundError/CommandNotFound on Windows systems.
  2. Hardcoded Linux temp paths: The default output directory is hardcoded to /tmp/ernie_image_ov_test, which is Unix-specific.
  3. Hardcoded developer paths: The default --model-path is hardcoded to a developer's local home directory (/home/ethan/intel/ERNIE-image/ERNIE-Image), exposing personal directory structures and failing cleanly for any other user without manually overriding the argument.

Expected Behavior

Test scripts in the repository should be fully cross-platform and rely on agnostic Python libraries (tempfile, shutil) rather than OS-specific CLI utilities, and should not contain hardcoded private paths.

Proposed Solution

  • Replace rm -rf subprocess calls with Python's cross-platform shutil.rmtree().
  • Replace the /tmp/ default string with tempfile.gettempdir().
  • Remove the developer-specific default model path and mark the argument natively as required=True.

I would like to work on this issue and submit a PR to resolve cross-platform testing issues.

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