tests: move "venv" to "build-root" directory from "test" directory
Type: refactor - refactored VPP test code to remove "ignore_path" variable from "discover_tests" function and "run_test" code - configured VPP test makefile, config file, and 'run.sh' shell script to move "venv" directory from "test" dir to "build-root" dir Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com> Change-Id: Id2beecbb99f24ce13ed118a1869c5adbef247e50
This commit is contained in:

committed by
Dave Wallace

parent
5c9f9968de
commit
c7f93b321d
2
.gitignore
vendored
2
.gitignore
vendored
@ -18,10 +18,10 @@
|
|||||||
/build-root/rpmbuild/
|
/build-root/rpmbuild/
|
||||||
/build-root/test-doc/
|
/build-root/test-doc/
|
||||||
/build-root/test-cov/
|
/build-root/test-cov/
|
||||||
|
/build-root/test/
|
||||||
/test/run/
|
/test/run/
|
||||||
/test/build/
|
/test/build/
|
||||||
/test/coverage/
|
/test/coverage/
|
||||||
/test/venv/
|
|
||||||
/test/vapi_test/
|
/test/vapi_test/
|
||||||
/test/doc/build/
|
/test/doc/build/
|
||||||
/build-config.mk
|
/build-config.mk
|
||||||
|
@ -54,7 +54,8 @@ PYTHON_OPTS="-m cProfile $(PROFILE_OUTPUT_OPTS) -s $(PROFILE_SORT_BY)"
|
|||||||
FORCE_FOREGROUND=1
|
FORCE_FOREGROUND=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VENV_PATH=$(TEST_DIR)/venv
|
VENV_BR_DIR=$(BR)/test
|
||||||
|
VENV_PATH=$(VENV_BR_DIR)/venv
|
||||||
|
|
||||||
ifeq ($(TEST_DEBUG),1)
|
ifeq ($(TEST_DEBUG),1)
|
||||||
VENV_RUN_DIR:=$(VENV_PATH)/run-debug
|
VENV_RUN_DIR:=$(VENV_PATH)/run-debug
|
||||||
@ -314,7 +315,7 @@ reset:
|
|||||||
|
|
||||||
.PHONY: wipe
|
.PHONY: wipe
|
||||||
wipe: reset
|
wipe: reset
|
||||||
@rm -rf $(VENV_PATH)
|
@rm -rf $(VENV_BR_DIR)
|
||||||
@rm -rf $(patsubst %,%/__pycache__, $(VPP_TEST_DIRS))
|
@rm -rf $(patsubst %,%/__pycache__, $(VPP_TEST_DIRS))
|
||||||
|
|
||||||
$(BUILD_COV_DIR):
|
$(BUILD_COV_DIR):
|
||||||
|
@ -395,7 +395,7 @@ config.test_src_dir = test_dirs
|
|||||||
|
|
||||||
|
|
||||||
if config.venv_dir is None:
|
if config.venv_dir is None:
|
||||||
config.venv_dir = f"{ws}/test/venv"
|
config.venv_dir = f"{ws}/build-root/test/venv"
|
||||||
|
|
||||||
if config.failed_dir is None:
|
if config.failed_dir is None:
|
||||||
config.failed_dir = f"{config.tmp_dir}"
|
config.failed_dir = f"{config.tmp_dir}"
|
||||||
|
@ -7,14 +7,12 @@ import importlib
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
def discover_tests(directory, callback, ignore_path):
|
def discover_tests(directory, callback):
|
||||||
do_insert = True
|
do_insert = True
|
||||||
for _f in os.listdir(directory):
|
for _f in os.listdir(directory):
|
||||||
f = "%s/%s" % (directory, _f)
|
f = "%s/%s" % (directory, _f)
|
||||||
if os.path.isdir(f):
|
if os.path.isdir(f):
|
||||||
if ignore_path is not None and f.startswith(ignore_path):
|
discover_tests(f, callback)
|
||||||
continue
|
|
||||||
discover_tests(f, callback, ignore_path)
|
|
||||||
continue
|
continue
|
||||||
if not os.path.isfile(f):
|
if not os.path.isfile(f):
|
||||||
continue
|
continue
|
||||||
|
@ -947,11 +947,10 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
filter_cb = FilterByTestOption(filter_file, filter_class, filter_func)
|
filter_cb = FilterByTestOption(filter_file, filter_class, filter_func)
|
||||||
|
|
||||||
ignore_path = config.venv_dir
|
|
||||||
cb = SplitToSuitesCallback(filter_cb)
|
cb = SplitToSuitesCallback(filter_cb)
|
||||||
for d in config.test_src_dir:
|
for d in config.test_src_dir:
|
||||||
print("Adding tests from directory tree %s" % d)
|
print("Adding tests from directory tree %s" % d)
|
||||||
discover_tests(d, cb, ignore_path)
|
discover_tests(d, cb)
|
||||||
|
|
||||||
# suites are not hashable, need to use list
|
# suites are not hashable, need to use list
|
||||||
suites = []
|
suites = []
|
||||||
|
@ -55,7 +55,7 @@ fi
|
|||||||
|
|
||||||
if [ -z "$venv_dir" ]
|
if [ -z "$venv_dir" ]
|
||||||
then
|
then
|
||||||
venv_dir="$ws_dir/test/venv"
|
venv_dir="$ws_dir/build-root/test/venv"
|
||||||
echo "Argument --venv-path not specified, defaulting to '$venv_dir'"
|
echo "Argument --venv-path not specified, defaulting to '$venv_dir'"
|
||||||
extra_args="$extra_args --venv-dir=$venv_dir"
|
extra_args="$extra_args --venv-dir=$venv_dir"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user