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):
- 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.
- Hardcoded Linux temp paths: The default output directory is hardcoded to
/tmp/ernie_image_ov_test, which is Unix-specific.
- 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.
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):subprocess.run(["rm", "-rf", dir])to clear output models. This will fail with aFileNotFoundError/CommandNotFoundon Windows systems./tmp/ernie_image_ov_test, which is Unix-specific.--model-pathis 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
rm -rfsubprocess calls with Python's cross-platformshutil.rmtree()./tmp/default string withtempfile.gettempdir().required=True.I would like to work on this issue and submit a PR to resolve cross-platform testing issues.