You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/12/08 00:57:30 UTC

[GitHub] [tvm] mehrdadh commented on a change in pull request #9663: [TVMC][MicroTVM] Fix tvmc micro `project_dir` arg relative path

mehrdadh commented on a change in pull request #9663:
URL: https://github.com/apache/tvm/pull/9663#discussion_r764471742



##########
File path: tests/micro/common/test_tvmc.py
##########
@@ -118,17 +126,25 @@ def test_tvmc_model_build_only(board):
         ["micro", "build", project_dir, platform, "--project-option", f"{platform}_board={board}"]
     )
     assert cmd_result == 0, "tvmc micro failed in step: build"
+    shutil.rmtree(output_dir)
 
 
 @pytest.mark.requires_hardware
 @tvm.testing.requires_micro
-def test_tvmc_model_run(board):
+@pytest.mark.parametrize(
+    "output_dir,",
+    [pathlib.Path("./tvmc_relative_path_test"), pathlib.Path(tempfile.mkdtemp())],
+)
+def test_tvmc_model_run(board, output_dir):
     target, platform = _get_target_and_platform(board)
 
+    if not os.path.isabs(output_dir):

Review comment:
       done.

##########
File path: python/tvm/driver/tvmc/micro.py
##########
@@ -236,18 +236,26 @@ def drive_micro(args):
     args.subcommand_handler(args)
 
 
+def get_project_dir(args: argparse.Namespace) -> str:

Review comment:
       moved the function and changed input type.

##########
File path: tests/micro/common/test_tvmc.py
##########
@@ -66,13 +67,20 @@ def test_tvmc_exist(board):
 
 
 @tvm.testing.requires_micro
-def test_tvmc_model_build_only(board):
+@pytest.mark.parametrize(
+    "output_dir,",
+    [pathlib.Path("./tvmc_relative_path_test"), pathlib.Path(tempfile.mkdtemp())],
+)
+def test_tvmc_model_build_only(board, output_dir):
     target, platform = _get_target_and_platform(board)
 
+    if not os.path.isabs(output_dir):

Review comment:
       Thanks for catching this. Initially the test was correct, I added that last piece to create the directory before running tvmc command which made the test wrong. Now it should be correct. Please let me know




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org