From ede5f8ed5871e82992a136d3049f5f3cc8eb8bfb Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Sun, 7 Feb 2021 22:11:04 -0700 Subject: [PATCH] [Flow] Support multi-user enviroment for running task --- .github/workflows/fpga_sdc_reg_test.sh | 7 +++++++ openfpga_flow/scripts/run_fpga_task.py | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fpga_sdc_reg_test.sh b/.github/workflows/fpga_sdc_reg_test.sh index c4ff67a09..8dd1157f3 100755 --- a/.github/workflows/fpga_sdc_reg_test.sh +++ b/.github/workflows/fpga_sdc_reg_test.sh @@ -10,3 +10,10 @@ echo -e "FPGA-SDC regression tests"; echo -e "Testing SDC generation with time units"; run-task fpga_sdc/sdc_time_unit --debug --show_thread_logs + + +# Repgression test to test multi-user enviroment +# TODO : While restructuring regression test files +# move this to separate file +cp -r */*/fpga_sdc/sdc_time_unit /tmp/ +cd /tmp/ && run-task sdc_time_unit \ No newline at end of file diff --git a/openfpga_flow/scripts/run_fpga_task.py b/openfpga_flow/scripts/run_fpga_task.py index 9d20799df..af5a7b226 100644 --- a/openfpga_flow/scripts/run_fpga_task.py +++ b/openfpga_flow/scripts/run_fpga_task.py @@ -166,8 +166,14 @@ def generate_each_task_actions(taskname): """ # Check if task directory exists and consistent - curr_task_dir = os.path.join(gc["task_dir"], *(taskname)) - if not os.path.isdir(curr_task_dir): + local_tasks = os.path.join(*(taskname)) + repo_tasks = os.path.join(gc["task_dir"], *(taskname)) + if os.path.isdir(local_tasks): + os.chdir(local_tasks) + curr_task_dir = os.path.abspath(os.getcwd()) + elif os.path.isdir(repo_tasks): + curr_task_dir = repo_tasks + else: clean_up_and_exit("Task directory [%s] not found" % curr_task_dir) os.chdir(curr_task_dir)