From ec2281d19922168fe1de31a7a8646ddd6b53f896 Mon Sep 17 00:00:00 2001 From: YuanTingHsieh Date: Wed, 15 Jan 2025 01:28:53 -0800 Subject: [PATCH] Remove the build folder for unit test to ensure correctness --- .../app_common/executors/task_script_runner_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit_test/app_common/executors/task_script_runner_test.py b/tests/unit_test/app_common/executors/task_script_runner_test.py index c38cede02d..972988437d 100644 --- a/tests/unit_test/app_common/executors/task_script_runner_test.py +++ b/tests/unit_test/app_common/executors/task_script_runner_test.py @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import os +import shutil import sys import unittest @@ -26,6 +28,11 @@ def setUp(self) -> None: file_dir = os.path.dirname(os.path.realpath(__file__)) splits = file_dir.split(os.sep) self.nvflare_root = os.sep.join(splits[0:-4]) + # sometimes a build dir is generated, we need to remove + # to ensure test correctness + build_dir = os.path.join(self.nvflare_root, "build") + if os.path.exists(build_dir): + shutil.rmtree(build_dir) def test_app_scripts_and_args(self): script_path = "nvflare/cli.py"